Permalink
Browse files

Removed support for deprecated `insert_sql` in associations.

  • Loading branch information...
1 parent 9cdf891 commit 39ee74c4058d67dfabaf62b41994eee1a79c1bf2 Neeraj Singh committed Jul 2, 2013
@@ -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 @@ 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

0 comments on commit 39ee74c

Please sign in to comment.