Giter Club home page Giter Club logo

delegates_attributes_to's People

Contributors

esampaio avatar mguterl avatar pabloh avatar pahanix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

delegates_attributes_to's Issues

delegate item.attribute? method

I was wondering why item.attribute? (in the example, this would be u.firstname?) is not delegated.
in the example, you can delegate u.contact.firstname to u.firstname, but u.contact.firstname? is not delegated.
After a quick look in the code, all that needs to be done to support this is adding '?' to the ATTRIBUTE_SUFFIXES array.

typo in README

changed? is misspelled.

u.profile.about = "Bob"
u.chaged?                 # => true

u = User.last

u.chaged?                 # => false

NoMEthodError: private method 'changed_attributes' on Rails 3.2.8+

On at least Rails 3.2.8 using this gem results in the following exception when saving a model:
NoMethodError: private method `changed_attributes' called for #ModelClassName:instance

The visibility of #changed_attributes is inadvertently set to private by this gem and must instead be public as per ActiveRecord::Dirty

Using this monkey patch to force visibility of #changed_attributes to public again rectifies the problem:

class ActiveRecord::Base
  public :changed_attributes
end

attribute_mapper and date fields don't play well together

Currently, you cannot assign date or time attributes through delegates_attributes_to.

It raises MultiparameterAssignmentErrors in execute_callstrack_for_multiparameter_attributes because it unable to determine the klass on line 3044.

column_for_attribute needs to be smarter and look up the attribute on the delegate object.

This is with ActiveRecord 2.3.5.

Not working in Rails 3.1?

Seems like "loaded_#{association}?" is not defined in Rails 3.1... not sure what the replacement is.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.