Permalink
Browse files

Use the reflection name instead of the accessor

  • Loading branch information...
1 parent cae842e commit d300256ca4dd8b6f921afe8ef2de05d7e9c084e7 @rafaelfranca rafaelfranca committed Oct 9, 2013
@@ -86,6 +86,7 @@ def self.define_callbacks(model, reflection)
# Post.first.comments and Post.first.comments= methods are defined by this method...
def define_accessors(model, reflection)
mixin = model.generated_feature_methods
+ name = reflection.name
self.class.define_readers(mixin, name)
self.class.define_writers(mixin, name)
end
@@ -8,7 +8,7 @@ def valid_options
def define_accessors(model, reflection)
super
- self.class.define_constructors(model.generated_feature_methods, name) if reflection.constructable?
+ self.class.define_constructors(model.generated_feature_methods, reflection.name) if reflection.constructable?
end
# Defines the (build|create)_association methods for belongs_to or has_one association

0 comments on commit d300256

Please sign in to comment.