Skip to content
Browse files

hack not needed anymore (foreign_key update). fix last test failure \o/

  • Loading branch information...
1 parent dea4b59 commit dd6674a80b897c6750257b220275a519d7db8c2f @bbenezech bbenezech committed Aug 3, 2011
Showing with 0 additions and 1 deletion.
  1. +0 −1 lib/rails_admin/adapters/active_record.rb
View
1 lib/rails_admin/adapters/active_record.rb
@@ -21,7 +21,6 @@ def self.extended(abstract_model)
self.send(association.name).try(:id)
end
abstract_model.model.send(:define_method, "#{association.name}_id=") do |id|
- association.klass.update_all({ association.foreign_key => nil }, { association.foreign_key => self.id }) if self.id
self.send(association.name.to_s + '=', associated = (id.blank? ? nil : association.klass.find_by_id(id)))
end
end

0 comments on commit dd6674a

Please sign in to comment.
Something went wrong with that request. Please try again.