aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_methods.rb
Commit message (Collapse)AuthorAgeFilesLines
* ActiveRecord#attributes optimization: minimize objects createdTieg Zaharia2012-06-091-1/+3
|
* Fix #5549.Jon Leighton2012-03-281-0/+1
|
* Merge pull request #5316 from Jacobkg/masterJosé Valim2012-03-071-1/+1
| | | | Update ActiveRecord::AttributeMethods#attribute_present? to return false for empty strings
* Improve deprecation messageJon Leighton2012-01-311-7/+17
|
* Add workaround and deprecation if the inherited hook is not executed. Closes ↵Jon Leighton2012-01-311-0/+12
| | | | #4757.
* Fix another race condition.Jon Leighton2012-01-201-3/+0
| | | | | | | | | | From 2c667f69aa2daac5ee6c29ca9679616e2a71532a. Thanks @pwnall for the heads-up. Conflicts: activerecord/lib/active_record/core.rb
* Fix race condition :bomb:Jon Leighton2012-01-131-4/+11
|
* Merge pull request #4408 from tomstuart/read-and-write-attribute-aliasesSantiago Pastorino2012-01-111-4/+6
| | | | #[] and #[]= are no longer interchangeable with #read_attribute and #write_attribute
* Fix situation where id method didn't get defined causing postgres to failJon Leighton2011-12-231-4/+3
|
* Fix #4046.Jon Leighton2011-12-231-42/+33
|
* Let AttributeMethods do its own including etcJon Leighton2011-12-151-0/+23
|
* Split out most of the AR::Base code into separate modules :cake:Jon Leighton2011-12-151-2/+113
|
* Use a separate module for 'external' attribute methods.Jon Leighton2011-12-141-0/+14
|
* Remove the need for type_cast_attribute.Jon Leighton2011-12-011-0/+4
| | | | This is good because it reduces duplication.
* Remove unnecessary *argsJon Leighton2011-12-011-2/+2
|
* Stop trying to be clever about when to define attribute methods.Jon Leighton2011-09-141-10/+1
| | | | | | | | | There is no meaningful performance penalty in defining attribute methods, since it only happens once. There is also no reason *not* to define them, since they get thrown in an included module, so they will not 'overwrite' anything. In fact, this is desirable, since it allows us to call super.
* We don't need to build a set for DangerousAttributeError.Jon Leighton2011-09-141-7/+13
| | | | We can just use method_defined? and private_method_defined?
* Deprecate using method_missing for attributes that are columns.Jon Leighton2011-09-131-0/+15
| | | | | | This shouldn't ever happen unless people are doing something particularly weird, but adding a deprecation in case there are bugs not caught by our tests.
* Let Ruby deal with method visibility.Jon Leighton2011-09-131-7/+10
| | | | | | Check respond_to_without_attributes? in method_missing. If there is any method that responds (even private), let super handle it and raise NoMethodError if necessary.
* Always generate attribute methods on the base class.Jon Leighton2011-09-131-5/+18
| | | | | | | | | | | | | | This fixes a situation I encountered where a subclass would cache the name of a generated attribute method in @_defined_class_methods. Then, when the superclass has it's attribute methods undefined, the subclass would always have to dispatch through method_missing, because the presence of the attribute in @_defined_class_methods would mean that it is never generated again, even if undefine_attribute_methods is called on the subclass. There various other confusing edge cases like this. STI classes share columns, so let's just keep all the attribute method generation state isolated to the base class.
* Fix warnings.Jon Leighton2011-09-131-1/+1
| | | | Make sure we don't redefine an already-defined attribute method.
* match method signature of the superclassAaron Patterson2011-06-301-1/+1
|
* Move ActiveModel::AttributeMethods#attribute_methods_generated? to ↵Alexander Uvarov2011-03-011-0/+11
| | | | | | | | ActiveRecord, so it's flexible now [#6428 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* instance_methods includes public and protected, so reduce funcalls and ↵Aaron Patterson2011-02-181-3/+2
| | | | object allocs
* AR::AttributeMethods does not need to be included in an AR::Base class.Aaron Patterson2011-02-181-1/+5
|
* just use the list of column names to generate attribute methodsAaron Patterson2011-02-181-1/+1
|
* Work around a strange piece of Syck behaviour where it checks ↵Michael Koziarski2010-12-021-1/+1
| | | | | | Model#respond_to? before initializing the object. Things like YAML.load(YAML.dump(@post)) won't work without this.
* "instance_methods" includes public and protectedAaron Patterson2010-10-191-1/+1
|
* Cheaper attribute reads and respond_to?. Add underscore-prefixed method ↵Jeremy Kemper2010-09-091-2/+2
| | | | aliased to the attribute name so it can be overridden but still called internally.
* Adds title and basic description where needed.Rizwan Reza2010-06-151-0/+1
|
* eliminate alias_method_chain from ActiveRecordwycats2010-05-091-1/+10
|
* No need to check for generated method, just redispatchJeremy Kemper2009-11-141-4/+3
|
* Extract generic attribute method generation to AMoJoshua Peek2009-08-041-241/+10
|
* whitespaceJoshua Peek2009-08-041-5/+5
|
* Modified ActiveRecord::AttributeMethods to allow classes to specify ↵Paul Gillard2009-08-041-37/+117
| | | | | | attribute method prefixes and/or suffixes. Previously only suffixes were allowed. Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Track generated attribute methods in a separate moduleJoshua Peek2009-08-021-30/+14
|
* Start separating primary key concernsJoshua Peek2009-07-301-0/+30
|
* Make sure we use send for the default attribute method body because the ↵Joshua Peek2009-07-301-1/+1
| | | | suffix maybe an invalid method name
* Make sure to reset defined methods after calling attribute_method_suffixJoshua Peek2009-07-301-9/+7
|
* Move attribute_types_cached_by_default into attribute methods reading concernJoshua Peek2009-07-301-10/+0
|
* Don't need to pass attr_name to evaluate_attribute_method anymoreJoshua Peek2009-07-301-4/+4
|
* Undefine id and let it automatically be generatedJoshua Peek2009-07-301-4/+4
|
* Redirect method missing for primary key to read_attributeJoshua Peek2009-07-301-3/+1
|
* ditto for id=Joshua Peek2009-07-301-3/+3
|
* Don't define id_before_type_cast, just let it be generated on its ownJoshua Peek2009-07-301-1/+1
|
* Restore DangerousAttributeErrorJoshua Peek2009-07-301-3/+9
|
* Wrap up attribute method reset concerns in 'undefine_attribute_methods'Joshua Peek2009-07-301-0/+5
|
* read_attribute is always available through attributeJoshua Peek2009-07-301-7/+1
|
* cache_attributes is related to attribute readingJoshua Peek2009-07-301-19/+0
|
* Generate methods for all suffixesJoshua Peek2009-07-301-11/+4
|