Permalink
Browse files

- ActiveResource assocition belongs_to dont save the obj.

  • Loading branch information...
1 parent 47caf7e commit 4b6a8170be0dc81afb5f8e8fa1714f0bba326313 @gramos committed Sep 29, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 activeresource/lib/active_resource/associations.rb
@@ -91,7 +91,7 @@ def belongs_to(resource, opts = {})
#----------------------------------------------------------------------#
define_method("#{resource}=") do |new_resource|
if send(o[:association_col]) != new_resource.id
- send(:update_attribute, o[:association_col], new_resource.id)
+ send "#{o[:association_col]}=", new_resource.id
end
instance_variable_set("@#{resource}", new_resource)
end

0 comments on commit 4b6a817

Please sign in to comment.