Skip to content

Commit

Permalink
remove calls to deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Dec 2, 2010
1 parent b0fc912 commit 9a3e29e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Expand Up @@ -76,9 +76,10 @@ def delete_records(records)
records.each { |record| @owner.connection.delete(interpolate_sql(sql, record)) }
else
relation = Arel::Table.new(@reflection.options[:join_table])
relation.where(relation[@reflection.primary_key_name].eq(@owner.id).
stmt = relation.where(relation[@reflection.primary_key_name].eq(@owner.id).
and(relation[@reflection.association_foreign_key].in(records.map { |x| x.id }.compact))
).delete
).compile_delete
@owner.connection.delete stmt.to_sql
end
end

Expand Down
3 changes: 2 additions & 1 deletion activerecord/lib/active_record/migration.rb
Expand Up @@ -696,7 +696,8 @@ def record_version_state_after_migrating(version)
@migrated_versions ||= []
if down?
@migrated_versions.delete(version)
table.where(table["version"].eq(version.to_s)).delete
stmt = table.where(table["version"].eq(version.to_s)).compile_delete
Base.connection.delete stmt.to_sql
else
@migrated_versions.push(version).sort!
stmt = table.compile_insert table["version"] => version.to_s
Expand Down

0 comments on commit 9a3e29e

Please sign in to comment.