1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Removed support for deprecated insert_sql in associations.

This commit is contained in:
Neeraj Singh 2013-07-02 23:37:08 +05:30
parent 9cdf891237
commit 39ee74c405
3 changed files with 10 additions and 10 deletions

View file

@ -1,3 +1,7 @@
* Removed support for deprecated `insert_sql` in associations.
*Neeraj Singh*
* Removed support for deprecated `finder_sql` in associations.
*Neeraj Singh*

View file

@ -5,7 +5,7 @@ module ActiveRecord::Associations::Builder
end
def valid_options
super + [:join_table, :association_foreign_key, :delete_sql, :insert_sql]
super + [:join_table, :association_foreign_key, :delete_sql]
end
def build

View file

@ -18,16 +18,12 @@ module ActiveRecord
end
end
if options[:insert_sql]
owner.connection.insert(interpolate(options[:insert_sql], record))
else
stmt = join_table.compile_insert(
join_table[reflection.foreign_key] => owner.id,
join_table[reflection.association_foreign_key] => record.id
)
stmt = join_table.compile_insert(
join_table[reflection.foreign_key] => owner.id,
join_table[reflection.association_foreign_key] => record.id
)
owner.class.connection.insert stmt
end
owner.class.connection.insert stmt
record
end