Skip to content

Commit

Permalink
Fixing one method
Browse files Browse the repository at this point in the history
  • Loading branch information
glennpow committed Mar 18, 2009
1 parent a481b9b commit 2217b6a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/active_enumeration/has_enumeration.rb
Expand Up @@ -25,7 +25,11 @@ def has_enumeration(name, options = {})
else
reflection.klass[value]
end
self.send("#{reflection.foreign_key}=", enumerate.key)
if reflection.foreign_key.to_s == name.to_s
super(enumerate.key)
else
self.send("#{reflection.foreign_key}=", enumerate.key)
end
end
end
end
Expand Down

0 comments on commit 2217b6a

Please sign in to comment.