Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | return early if the cast attribute has been cached | Aaron Patterson | 2012-02-08 | 1 | -11/+16 | |
| | ||||||
* | always call `read_attribute` from the reader method | Aaron Patterson | 2012-02-08 | 1 | -14/+12 | |
| | ||||||
* | cache attribute if it is supposed to be cached | Aaron Patterson | 2012-02-07 | 1 | -1/+5 | |
| | ||||||
* | moving column types to an ivar on the result | Aaron Patterson | 2012-02-07 | 1 | -1/+5 | |
| | ||||||
* | moved attribute translation to an object | Aaron Patterson | 2012-02-07 | 1 | -16/+10 | |
| | ||||||
* | moved most of the evald code in to regular ruby code | Aaron Patterson | 2012-02-07 | 1 | -10/+28 | |
| | ||||||
* | copy the columns hash to the active record instances, typecast using columns ↵ | Aaron Patterson | 2012-02-07 | 1 | -3/+10 | |
| | | | | looked up on the instance | |||||
* | The primary key is always initialized in the @attributes hash to nil (unless | Aaron Patterson | 2012-01-25 | 1 | -5/+1 | |
| | | | | another value has been specified). | |||||
* | use fetch rather than both Hash#key? and Hash#[] | Aaron Patterson | 2012-01-25 | 1 | -49/+51 | |
| | ||||||
* | Revert "just use an alias. The target method is public, so make this one ↵ | Aaron Patterson | 2012-01-20 | 1 | -1/+4 | |
| | | | | | | public" This reverts commit be7d2248e9505983d1aacf0b33c657e6e3ddd9db. | |||||
* | just use an alias. The target method is public, so make this one public | Aaron Patterson | 2012-01-19 | 1 | -4/+1 | |
| | | | | too. | |||||
* | Support configuration on ActiveRecord::Model. | Jon Leighton | 2011-12-28 | 1 | -1/+4 | |
| | | | | | | | | | | | | | | | The problem: We need to be able to specify configuration in a way that can be inherited to models that include ActiveRecord::Model. So it is no longer sufficient to put 'top level' config on ActiveRecord::Base, but we do want configuration specified on ActiveRecord::Base and descendants to continue to work. So we need something like class_attribute that can be defined on a module but that is inherited when ActiveRecord::Model is included. The solution: added ActiveModel::Configuration module which provides a config_attribute macro. It's a bit specific hence I am not putting this in Active Support or making it a 'public API' at present. | |||||
* | Deal with global config better between AR::Base and AR::Model | Jon Leighton | 2011-12-24 | 1 | -4/+1 | |
| | ||||||
* | Doh, remove debugging line | Jon Leighton | 2011-12-23 | 1 | -1/+0 | |
| | ||||||
* | Fix #4046. | Jon Leighton | 2011-12-23 | 1 | -4/+3 | |
| | ||||||
* | Make read_attribute code path accessible at the class level | Jon Leighton | 2011-12-22 | 1 | -19/+21 | |
| | ||||||
* | Stop the build asploding on 1.8.7 | Jon Leighton | 2011-12-14 | 1 | -0/+2 | |
| | ||||||
* | Use a separate module for 'external' attribute methods. | Jon Leighton | 2011-12-14 | 1 | -14/+9 | |
| | ||||||
* | fixing eval'd line numbers. | Aaron Patterson | 2011-12-08 | 1 | -2/+2 | |
| | ||||||
* | Revert "Roflscaling!" (for now) | Jon Leighton | 2011-12-02 | 1 | -6/+9 | |
| | | | | | | | | This reverts commit f6b5046305d43c5f64bcb6fed0e44f7bca99a603. Fear not, the roflscale will return when I have a bit more time and figure out a better way to do it. (In particular, a way that doesn't break the build.) | |||||
* | Fewer string allocations in attribute method | Jon Leighton | 2011-12-01 | 1 | -4/+4 | |
| | ||||||
* | Roflscaling! | Jon Leighton | 2011-12-01 | 1 | -9/+6 | |
| | | | | | Don't prefix the name with attribute_. Avoids a string allocation on read_attribute, which is a bit faster. | |||||
* | Create method with known identifier then alias into place. | Jon Leighton | 2011-12-01 | 1 | -25/+21 | |
| | | | | | | | | This means we never have to rely on define_method (which is slower and uses more memory), even when we have attributes containing characters that are not allowed in standard method names. (I am mainly changing this because the duplication annoys me, though.) | |||||
* | Remove some unnecessary code etc | Jon Leighton | 2011-12-01 | 1 | -7/+8 | |
| | ||||||
* | Add test for read_attribute(:id) with non-standard PK. | Jon Leighton | 2011-12-01 | 1 | -4/+4 | |
| | | | | | | | | Also make it actually work. It slows down all read_attribute accesses to map 'id' to whatever the PK actually is, inside read_attribute. So instead make sure the necessary methods are defined and that they redirect wherever they need to go. | |||||
* | Remove the need for type_cast_attribute. | Jon Leighton | 2011-12-01 | 1 | -31/+31 | |
| | | | | This is good because it reduces duplication. | |||||
* | Get rid of the underscore versions of attribute methods! | Jon Leighton | 2011-12-01 | 1 | -4/+0 | |
| | | | | This makes me happy! | |||||
* | Don't rely on underscore-prefixed attribute methods. | Jon Leighton | 2011-12-01 | 1 | -30/+61 | |
| | | | | | | Define singleton methods on the attributes module instead. This reduces method pollution on the actual model classes. It also seems to make something faster, I am unsure why! O_o | |||||
* | consistency | Jon Leighton | 2011-11-30 | 1 | -10/+10 | |
| | ||||||
* | Don't need second param | Jon Leighton | 2011-11-30 | 1 | -3/+3 | |
| | ||||||
* | No longer need to undef id as we are defining it ourselves | Jon Leighton | 2011-11-30 | 1 | -3/+0 | |
| | ||||||
* | Extract attribute serialization code into a separate module | Jon Leighton | 2011-11-30 | 1 | -28/+5 | |
| | ||||||
* | Use inheritance to avoid special-case code for the 'id' method | Jon Leighton | 2011-11-30 | 1 | -4/+0 | |
| | ||||||
* | Speed up attribute invocation by checking if both name and calls are compilable. | José Valim | 2011-11-14 | 1 | -1/+1 | |
| | ||||||
* | Revert "Raise error on unknown primary key." | Jon Leighton | 2011-10-05 | 1 | -3/+3 | |
| | | | | This reverts commit ee2be435b1e5c0e94a4ee93a1a310e0471a77d07. | |||||
* | Raise error on unknown primary key. | Jon Leighton | 2011-10-05 | 1 | -3/+3 | |
| | | | | | If we don't have a primary key when we ask for it, it's better to fail fast. Fixes GH #2307. | |||||
* | Add deprecation for doing `attribute_method_suffix ''` | Jon Leighton | 2011-09-13 | 1 | -2/+0 | |
| | ||||||
* | only calculate method name once | Aaron Patterson | 2011-06-30 | 1 | -2/+3 | |
| | ||||||
* | Remove extra white spaces on ActiveRecord docs. | Sebastian Martinez | 2011-05-23 | 1 | -1/+1 | |
| | ||||||
* | Avoid define_method if possible. | José Valim | 2011-04-19 | 1 | -1/+1 | |
| | ||||||
* | Return nil from read_attribute(:foo) if 'foo' is not present in the ↵ | Jon Leighton | 2011-04-15 | 1 | -1/+1 | |
| | | | | @attributes hash, but the _foo method has been defined. This brings the behaviour into line with the 3-0-stable branch and the master branch before 93641ed6c8c684f6b4db02b6c8a22fa9bc7f0eaf (there were previously no assertions about this which is why the change slipped through). Note that actually calling the 'foo' method will still raise an error if the attribute is not present. | |||||
* | Undo performances regressions I introduced in ↵ | Jon Leighton | 2011-04-15 | 1 | -5/+23 | |
| | | | | bbe0a507f287c20ab4ae8a244fbfc810665deda5 and add test for an edge case. Add comments to explain the intent of the code. | |||||
* | Remove unnecessary code from define_read_method and add assertion to make ↵ | Jon Leighton | 2011-04-15 | 1 | -7/+4 | |
| | | | | sure the underscored version is actually generated | |||||
* | Fixes performance issue introduced in 3.0.6 (issue #6695) | Stian Grytøyr | 2011-04-14 | 1 | -3/+5 | |
| | ||||||
* | use class_eval with a string when it's possible | Santiago Pastorino | 2011-03-22 | 1 | -3/+7 | |
| | ||||||
* | Allow to read and write AR attributes with non valid identifiers | Santiago Pastorino | 2011-03-22 | 1 | -1/+4 | |
| | ||||||
* | make sure de-serialization happens on object instantiation | Aaron Patterson | 2011-02-01 | 1 | -1/+1 | |
| | ||||||
* | move the coders to the serialized_attributes hash | Aaron Patterson | 2011-02-01 | 1 | -7/+3 | |
| | ||||||
* | use an identity conversion to avoid conditional codes | Aaron Patterson | 2011-01-28 | 1 | -2/+2 | |
| | ||||||
* | join the cult of cargo. reduce the number of NoMethodErrors in the system | Aaron Patterson | 2011-01-07 | 1 | -1/+1 | |
| |