- 24 12月, 2011 1 次提交
-
-
由 Jon Leighton 提交于
-
- 22 12月, 2011 1 次提交
-
-
由 Sergey Nartimov 提交于
-
- 16 12月, 2011 2 次提交
-
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
- 14 12月, 2011 1 次提交
-
-
由 Jon Leighton 提交于
-
- 02 12月, 2011 2 次提交
-
-
由 Jon Leighton 提交于
This is good because it reduces duplication.
-
由 Jon Leighton 提交于
-
- 28 11月, 2011 1 次提交
-
-
由 Josh Susser 提交于
-
- 16 11月, 2011 1 次提交
-
-
由 Josh Susser 提交于
Instead of generating association methods directly in the model class, they are generated in an anonymous module which is then included in the model class. There is one such module for each association. The only subtlety is that the generated_attributes_methods module (from ActiveModel) must be forced to be included before association methods are created so that attribute methods will not shadow association methods.
-
- 14 9月, 2011 2 次提交
-
-
由 Jon Leighton 提交于
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.
-
由 Jon Leighton 提交于
We can just use method_defined? and private_method_defined?
-
- 13 9月, 2011 4 次提交
-
-
由 Jon Leighton 提交于
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.
-
由 Jon Leighton 提交于
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.
-
由 Jon Leighton 提交于
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.
-
由 Jon Leighton 提交于
Make sure we don't redefine an already-defined attribute method.
-
- 01 7月, 2011 1 次提交
-
-
由 Aaron Patterson 提交于
-
- 02 3月, 2011 1 次提交
-
-
由 Alexander Uvarov 提交于
Move ActiveModel::AttributeMethods#attribute_methods_generated? to ActiveRecord, so it's flexible now [#6428 state:resolved] Signed-off-by: NJosé Valim <jose.valim@gmail.com>
-
- 19 2月, 2011 3 次提交
-
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-
- 03 12月, 2010 1 次提交
-
-
由 Michael Koziarski 提交于
Work around a strange piece of Syck behaviour where it checks Model#respond_to? before initializing the object. Things like YAML.load(YAML.dump(@post)) won't work without this.
-
- 19 10月, 2010 1 次提交
-
-
由 Aaron Patterson 提交于
-
- 10 9月, 2010 1 次提交
-
-
由 Jeremy Kemper 提交于
Cheaper attribute reads and respond_to?. Add underscore-prefixed method aliased to the attribute name so it can be overridden but still called internally.
-
- 16 6月, 2010 1 次提交
-
-
由 Rizwan Reza 提交于
-
- 09 5月, 2010 1 次提交
-
-
由 wycats 提交于
-
- 14 11月, 2009 1 次提交
-
-
由 Jeremy Kemper 提交于
-
- 05 8月, 2009 3 次提交
-
-
由 Joshua Peek 提交于
-
由 Joshua Peek 提交于
-
由 Paul Gillard 提交于
Modified ActiveRecord::AttributeMethods to allow classes to specify attribute method prefixes and/or suffixes. Previously only suffixes were allowed. Signed-off-by: NJoshua Peek <josh@joshpeek.com>
-
- 03 8月, 2009 1 次提交
-
-
由 Joshua Peek 提交于
-
- 31 7月, 2009 10 次提交
-
-
由 Joshua Peek 提交于
-
由 Joshua Peek 提交于
Make sure we use send for the default attribute method body because the suffix maybe an invalid method name
-
由 Joshua Peek 提交于
-
由 Joshua Peek 提交于
-
由 Joshua Peek 提交于
-
由 Joshua Peek 提交于
-
由 Joshua Peek 提交于
-
由 Joshua Peek 提交于
-
由 Joshua Peek 提交于
-
由 Joshua Peek 提交于
-