Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Backport #8078: Fix `attributes_before_type_cast` for serialised attributes. | Nikita Afanasenko | 2012-11-09 | 1 | -0/+10 |
| | | | | Public method attributes_before_type_cast used to return internal AR structure (ActiveRecord::AttributeMethods::Serialization::Attribute), patch fixes this. Now behaves like read_attribute_before_type_cast and returns unserialised values. | ||||
* | Merge pull request #3544 from amatsuda/_field_changed | Aaron Patterson | 2012-09-21 | 1 | -3/+3 |
| | | | | | | | | Rename field_changed? to _field_changed? so that users can create a field named field Conflicts: activerecord/lib/active_record/core.rb activerecord/test/cases/dirty_test.rb | ||||
* | Merge pull request #6986 from kennyj/fix_6975 | Rafael Mendonça França | 2012-08-21 | 1 | -5/+14 |
| | | | | | | | Fix #6975. Round usec when writing timestamp attribute. Conflicts: activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb | ||||
* | Do not consider the numeric attribute as changed if the old value is | Rafael Mendonça França | 2012-08-02 | 1 | -1/+1 |
| | | | | | | | | | | | | | | | | | | | | zero and the new value is not a string. Before this commit this was the behavior r = Review.find_by_issue(0) r.issue => 0 r.changes => {} r.issue = 0 => 0 r.changed? => true r.changes => {"issue"=>[0,0]} Fixes #7237 | ||||
* | Merge branch 'acapilleri-update_nested_attributes' | Rafael Mendonça França | 2012-06-21 | 1 | -5/+15 |
| | | | | | | | Closes #6675 Conflicts: activerecord/lib/active_record/attribute_methods/dirty.rb | ||||
* | Fix #6591. If a field with timezone isn't changed, we don't call will_change!. | kennyj | 2012-06-04 | 1 | -1/+2 |
| | |||||
* | Merge pull request #5810 from kennyj/fix_5797 | Aaron Patterson | 2012-05-30 | 1 | -3/+4 |
| | | | | | | Fix #5797. Error calling dup method on AR model with serialized field Conflicts: activerecord/lib/active_record/core.rb | ||||
* | Remove unused 'cast_code' variable | Kevin Moore | 2012-04-03 | 1 | -2/+0 |
| | |||||
* | Fix #5549. | Jon Leighton | 2012-03-28 | 1 | -3/+6 |
| | |||||
* | force datetime attributes to be changed | Sergey Nartimov | 2012-03-27 | 1 | -0/+1 |
| | | | | backport ddb5d2f756d9d2655a07791a3b62832efd588474 to 3-2-stable | ||||
* | Fix attribute_before_type_cast for serialized attributes. Fixes #4837. | Jon Leighton | 2012-02-07 | 1 | -0/+8 |
| | | | | | | Conflicts: activerecord/lib/active_record/core.rb | ||||
* | Allow writing unknown attributes, but with a deprecation warning. Closes #4583. | Jon Leighton | 2012-01-31 | 1 | -4/+7 |
| | |||||
* | 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 | 2 | -27/+33 |
| | |||||
* | Fix the build on postgres. Note: we should probably actually make schema ↵ | Jon Leighton | 2011-12-16 | 1 | -1/+1 |
| | | | | mutations bust the cache. | ||||
* | Don't store defaults in the schema cache | Jon Leighton | 2011-12-16 | 1 | -2/+2 |
| | |||||
* | Cache columns at the model level. | Jon Leighton | 2011-12-16 | 1 | -2/+0 |
| | | | | Allows two models to use the same table but have different primary keys. | ||||
* | Split out most of the AR::Base code into separate modules :cake: | Jon Leighton | 2011-12-15 | 1 | -0/+12 |
| | |||||
* | Fix #3987. | Jon Leighton | 2011-12-15 | 1 | -0/+2 |
| | |||||
* | 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 | 2 | -17/+12 |
| | |||||
* | use the schema cache when asking for the primary key | Aaron Patterson | 2011-12-12 | 1 | -1/+1 |
| | |||||
* | fixing eval'd line numbers. | Aaron Patterson | 2011-12-08 | 1 | -2/+2 |
| | |||||
* | Fix #3837. | Jon Leighton | 2011-12-03 | 1 | -11/+5 |
| | | | | | We also need to time zone convert time zone aware attributes when accessed via read_attribute, not only when via direct access. | ||||
* | Revert "Roflscaling!" (for now) | Jon Leighton | 2011-12-02 | 2 | -8/+11 |
| | | | | | | | | 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 | 2 | -11/+8 |
| | | | | | 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 | 2 | -26/+11 |
| | |||||
* | Add test for read_attribute(:id) with non-standard PK. | Jon Leighton | 2011-12-01 | 2 | -4/+18 |
| | | | | | | | | 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 | 3 | -42/+47 |
| | | | | This is good because it reduces duplication. | ||||
* | Get rid of the underscore versions of attribute methods! | Jon Leighton | 2011-12-01 | 3 | -6/+33 |
| | | | | This makes me happy! | ||||
* | Don't rely on underscore-prefixed attribute methods. | Jon Leighton | 2011-12-01 | 3 | -48/+80 |
| | | | | | | 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 | ||||
* | If the table behind has no primary key, do not ask again and just return nil. | Julius de Bruijn | 2011-11-30 | 1 | -1/+2 |
| | |||||
* | consistency | Jon Leighton | 2011-11-30 | 3 | -16/+16 |
| | |||||
* | Don't check column type, you might implement a custom coder that serializes ↵ | Jon Leighton | 2011-11-30 | 1 | -1/+1 |
| | | | | to a different type | ||||
* | omg computer science! | Jon Leighton | 2011-11-30 | 2 | -22/+44 |
| | | | | | | | Implement a mini state machine for serialized attributes. This means we do not have to deserialize the values upon initialization, which means that if we never actually access the attribute, we never have to deserialize it. | ||||
* | Don't need second param | Jon Leighton | 2011-11-30 | 2 | -4/+4 |
| | |||||
* | No longer need to undef id as we are defining it ourselves | Jon Leighton | 2011-11-30 | 1 | -3/+0 |
| | |||||
* | Move some serialization stuff out of Base | Jon Leighton | 2011-11-30 | 1 | -0/+42 |
| | |||||
* | Extract attribute serialization code into a separate module | Jon Leighton | 2011-11-30 | 2 | -28/+47 |
| | |||||
* | Use inheritance to avoid special-case code for the 'id' method | Jon Leighton | 2011-11-30 | 3 | -8/+20 |
| | |||||
* | #id is an alias for whatever the primary key is | Jon Leighton | 2011-11-30 | 1 | -1/+1 |
| | |||||
* | fix indent | Jon Leighton | 2011-11-30 | 1 | -3/+3 |
| | |||||
* | Deprecate set_primary_key in favour of self.primary_key= | Jon Leighton | 2011-11-29 | 1 | -20/+26 |
| | |||||
* | Speed up attribute invocation by checking if both name and calls are compilable. | José Valim | 2011-11-14 | 2 | -2/+2 |
| | |||||
* | Revert "Raise error on unknown primary key." | Jon Leighton | 2011-10-05 | 3 | -11/+4 |
| | | | | This reverts commit ee2be435b1e5c0e94a4ee93a1a310e0471a77d07. | ||||
* | Raise error on unknown primary key. | Jon Leighton | 2011-10-05 | 3 | -4/+11 |
| | | | | | If we don't have a primary key when we ask for it, it's better to fail fast. Fixes GH #2307. | ||||
* | Don't require a DB connection when setting primary key. | Jon Leighton | 2011-09-26 | 1 | -1/+0 |
| | | | | Closes #2807. |