diff options
author | José Valim <jose.valim@gmail.com> | 2010-02-28 11:43:13 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-02-28 11:43:13 +0100 |
commit | ae8070e21be405331a1ad97f59c4e43d45f10eb3 (patch) | |
tree | 75694477005c19deb8048d98845e3aab17c47fc8 /activemodel | |
parent | 32afcdcb889e651b13e161a04c4d6d2ea78a652f (diff) | |
download | rails-ae8070e21be405331a1ad97f59c4e43d45f10eb3.tar.gz rails-ae8070e21be405331a1ad97f59c4e43d45f10eb3.tar.bz2 rails-ae8070e21be405331a1ad97f59c4e43d45f10eb3.zip |
Add missing information about attributes method.
Diffstat (limited to 'activemodel')
-rw-r--r-- | activemodel/lib/active_model/attribute_methods.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/activemodel/lib/active_model/attribute_methods.rb b/activemodel/lib/active_model/attribute_methods.rb index 143eb87f54..588976f1d4 100644 --- a/activemodel/lib/active_model/attribute_methods.rb +++ b/activemodel/lib/active_model/attribute_methods.rb @@ -21,7 +21,6 @@ module ActiveModel # A minimal implementation could be: # # class Person - # # include ActiveModel::AttributeMethods # # attribute_method_affix :prefix => 'reset_', :suffix => '_to_default!' @@ -44,9 +43,13 @@ module ActiveModel # def reset_attribute_to_default!(attr) # send("#{attr}=", "Default Name") # end - # # end - # + # + # Please notice that whenever you include ActiveModel::AtributeMethods in your class, + # it requires you to implement a <tt>attributes</tt> methods which returns a hash with + # each attribute name in your model as hash key and the attribute value as hash value. + # Hash keys must be a string. + # module AttributeMethods extend ActiveSupport::Concern |