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:
parent
9cdf891237
commit
39ee74c405
3 changed files with 10 additions and 10 deletions
|
@ -1,3 +1,7 @@
|
|||
* Removed support for deprecated `insert_sql` in associations.
|
||||
|
||||
*Neeraj Singh*
|
||||
|
||||
* Removed support for deprecated `finder_sql` in associations.
|
||||
|
||||
*Neeraj Singh*
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue