aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_set.rb
Commit message (Collapse)AuthorAgeFilesLines
* AttributeSet#include? -> AttributeSet#key?Sean Griffin2014-07-111-3/+3
| | | | https://github.com/rails/rails/pull/15868/files#r14135210
* Merge pull request #16015 from sgrif/sg-ensure-initializedRafael Mendonça França2014-07-021-0/+6
|\ | | | | | | | | | | | | Move pk initialization logic onto `AttributeSet` Conflicts: activerecord/lib/active_record/attribute_set.rb
| * Move pk initialization logic onto `AttributeSet`Sean Griffin2014-07-021-0/+6
| | | | | | | | Better encapsulates its internals from `ActiveRecord::Base`.
* | Don't error when `dup`ing a record with no PKSean Griffin2014-07-021-0/+6
|/
* Use `Hash#transform_values` to clean up `AttributeSet`Sean Griffin2014-06-291-7/+3
|
* `Attribute` should know about its nameSean Griffin2014-06-261-8/+6
| | | | | This allows using polymorphism for the uninitialized attributes raising an exception behavior.
* Encapsulate the creation of `Attribute` objectsSean Griffin2014-06-261-1/+9
| | | | | | | | This will make it less painful to add additional properties, which should persist across writes, such as `name`. Conflicts: activerecord/lib/active_record/attribute_set.rb
* Merge pull request #15868 from sgrif/sg-uninitialized-attributesRafael Mendonça França2014-06-261-17/+24
|\ | | | | | | | | | | | | | | Move behavior of `read_attribute` to `AttributeSet` Conflicts: activerecord/lib/active_record/attribute_set.rb activerecord/test/cases/attribute_set_test.rb
| * Move behavior of `read_attribute` to `AttributeSet`Sean Griffin2014-06-251-17/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Moved `Builder` to its own file, as it started looking very weird once I added private methods to the `AttributeSet` class and the `Builder` class started to grow. Would like to refactor `fetch_value` to change to ```ruby self[name].value(&block) ``` But that requires the attributes to know about their name, which they currently do not.
* | Merge pull request #15846 from sgrif/sg-attributes-before-type-castRafael Mendonça França2014-06-261-1/+5
|\ \ | |/ |/| | | | | | | | | | | Move `attributes_before_type_cast` to `AttributeSet` Conflicts: activerecord/lib/active_record/attribute_set.rb activerecord/test/cases/attribute_set_test.rb
| * Move `attributes_before_type_cast` to `AttributeSet`Sean Griffin2014-06-211-1/+5
| |
* | add missing `:nodoc:` for recent refactorings. [ci skip]Yves Senn2014-06-241-2/+1
| | | | | | | | | | | | | | | | | | | | Adding `# :nodoc:` to the parent `class` / `module` is not going to ignore nested classes or modules. There is a modifier `# :nodoc: all` but sadly the containing class or module will continue to be in the docs. /cc @sgrif
* | `reload` should fully reload attributesSean Griffin2014-06-221-4/+0
| | | | | | | | | | | | `reload` is meant to put a record in the same state it would be if you were to do `Post.find(post.id)`. This means we should fully replace the attributes hash.
* | Merge pull request #15839 from sgrif/sg-attr-set-nullYves Senn2014-06-221-1/+2
|\ \ | | | | | | Return a null object from `AttributeSet#[]`
| * | Return a null object from `AttributeSet#[]`Sean Griffin2014-06-201-1/+2
| |/
* / Move `attributes` to the `AttributeSet` object.Sean Griffin2014-06-211-0/+5
|/
* Introduce an object to aid in creation and management of `@attributes`Sean Griffin2014-06-191-0/+51
Mostly delegation to start, but we can start moving a lot of behavior in bulk to this object.