search for: define_attribute_methods

Displaying 5 results from an estimated 5 matches for "define_attribute_methods".

2011 Feb 05
3
ActiveModel::AttributeMethods limiting
...r. class Model include ActiveModel::Dirty def self.property(name, klass = String) define_property_accessors(name, klass) # This method will be called once, because of https://github.com/rails/rails/blob/master/activemodel/lib/active_model/attribute_methods.rb#L263 define_attribute_methods([name]) end end class Article < Model property :title property :body property :published_at, Time end In the above example, attribute methods will be defined just for :title. I don''t see any nice workaround. So what is the purpose of AttributeMethods#attribute_methods...
2008 Jul 31
2
Freeze field in active record
...on : C:/DATA/InstantRails-2.0/ruby/lib/ruby/gems/1.8/gems/ activerecord-2.1.0/lib/active_record/attribute_methods.rb:104:in `instance_method_already_implemented?'' C:/DATA/InstantRails-2.0/ruby/lib/ruby/gems/1.8/gems/ activerecord-2.1.0/lib/active_record/attribute_methods.rb:72:in `define_attribute_methods'' C:/DATA/InstantRails-2.0/ruby/lib/ruby/gems/1.8/gems/ activerecord-2.1.0/lib/active_record/attribute_methods.rb:71:in `each'' C:/DATA/InstantRails-2.0/ruby/lib/ruby/gems/1.8/gems/ activerecord-2.1.0/lib/active_record/attribute_methods.rb:71:in `define_attribute_methods'...
2008 Jun 24
2
wrong number of arguments (1 for 0) when using respond_to?
...rd/attribute_methods.rb:102:in `sum'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/attribute_methods.rb:102:in `instance_method_already_implemented?'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/attribute_methods.rb:72:in `define_attribute_methods'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/attribute_methods.rb:71:in `each'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/attribute_methods.rb:71:in `define_attribute_methods'' /usr/local/lib/ruby/gems/1.8/...
2008 Feb 22
2
ActiveRecord::DangerousAttributeError ???
...s2 Application Trace | Framework Trace | Full Trace /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ attribute_methods.rb:88:in `instance_method_already_implemented?'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ attribute_methods.rb:64:in `define_attribute_methods'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ attribute_methods.rb:63:in `each'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ attribute_methods.rb:63:in `define_attribute_methods'' /usr/local/lib/ruby/gems/1.8/gems/activ...
2006 Mar 06
1
ActiveLDAP handle uppercase attributes?
Does anyone know how to assign values to LDAP objects with upper cased attributes? For example, you can normally do: user = User.new(@user) user.sn = params[:user][attr] But what about the case where there is an attribute that looks like OXTimeZone? You clearly can''t do: user = User.new(@user) user.OXTimeZone = params[:user][attr] I''m trying to