Module: BigRecord::ConnectionAdapters::DatabaseStatements
- Included in:
- AbstractAdapter
- Defined in:
- lib/big_record/connection_adapters/abstract/database_statements.rb
Instance Method Summary
-
- (Object) insert_fixture(fixture, table_name)
Inserts the given fixture into the table.
Instance Method Details
- (Object) insert_fixture(fixture, table_name)
Inserts the given fixture into the table. Overridden in adapters that require something beyond a simple insert (eg. Oracle).
6 7 8 9 10 11 12 |
# File 'lib/big_record/connection_adapters/abstract/database_statements.rb', line 6 def insert_fixture(fixture, table_name) # execute "INSERT INTO #{quote_table_name(table_name)} (#{fixture.key_list}) VALUES (#{fixture.value_list})", 'Fixture Insert' attributes = fixture.to_hash.dup id = attributes.delete("id") raise ArgumentError, "the id is missing" unless id update(table_name, id, attributes, Time.now.) end |