提交 39ee74c4 编写于 作者: N Neeraj Singh

Removed support for deprecated `insert_sql` in associations.

上级 9cdf8912
* Removed support for deprecated `insert_sql` in associations.
*Neeraj Singh*
* Removed support for deprecated `finder_sql` in associations.
*Neeraj Singh*
......
......@@ -5,7 +5,7 @@ def macro
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 @@ def insert_record(record, validate = true, raise = false)
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册