1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

11 commits

Author SHA1 Message Date
Sean Griffin
9c83e8401d AttributeSet#include? -> AttributeSet#key?
https://github.com/rails/rails/pull/15868/files#r14135210
2014-07-11 07:50:16 -06:00
Sean Griffin
bb7bc499e5 Attribute should know about its name
This allows using polymorphism for the uninitialized attributes raising
an exception behavior.
2014-06-26 07:18:21 -06:00
Sean Griffin
14b1208dd3 Encapsulate the creation of Attribute objects
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
2014-06-26 06:45:57 -03:00
Rafael Mendonça França
2571c3f415 Merge pull request #15868 from sgrif/sg-uninitialized-attributes
Move behavior of `read_attribute` to `AttributeSet`

Conflicts:
	activerecord/lib/active_record/attribute_set.rb
	activerecord/test/cases/attribute_set_test.rb
2014-06-26 06:40:08 -03:00
Rafael Mendonça França
e1ad3ed773 Merge pull request #15846 from sgrif/sg-attributes-before-type-cast
Move `attributes_before_type_cast` to `AttributeSet`

Conflicts:
	activerecord/lib/active_record/attribute_set.rb
	activerecord/test/cases/attribute_set_test.rb
2014-06-26 06:26:26 -03:00
Sean Griffin
a89f8a922d Move behavior of read_attribute to AttributeSet
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.
2014-06-25 08:51:15 -06:00
Yves Senn
5686fd0ca1 Merge pull request #15839 from sgrif/sg-attr-set-null
Return a null object from `AttributeSet#[]`
2014-06-22 13:59:27 +02:00
Sean Griffin
3e422e201d Move attributes to the AttributeSet object. 2014-06-21 13:09:48 -06:00
Sean Griffin
3ea9a88d80 Move attributes_before_type_cast to AttributeSet 2014-06-21 10:52:19 -06:00
Sean Griffin
6d7ac31ddb Return a null object from AttributeSet#[] 2014-06-20 11:36:23 -06:00
Sean Griffin
099af48d31 Introduce an object to aid in creation and management of @attributes
Mostly delegation to start, but we can start moving a lot of behavior in
bulk to this object.
2014-06-19 13:12:52 -06:00