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

5 commits

Author SHA1 Message Date
Sean Griffin
bc153cff91 Implement == on Type::Value and Attribute
This was a small self contained piece of the refactoring that I am
working on, which required these objects to be comparable.
2014-08-15 13:37:53 -06:00
Rajarshi Das
e67a2f26db rename MiniTest to Minitest 2014-08-02 21:30:28 +05:30
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
Sean Griffin
6f08db05c0 Introduce an Attribute object to handle the type casting dance
There's a lot more that can be moved to these, but this felt like a good
place to introduce the object. Plans are:

- Remove all knowledge of type casting from the columns, beyond a
  reference to the cast_type
- Move type_cast_for_database to these objects
- Potentially make them mutable, introduce a state machine, and have
  dirty checking handled here as well
- Move `attribute`, `decorate_attribute`, and anything else that
  modifies types to mess with this object, not the columns hash
- Introduce a collection object to manage these, reduce allocations, and
  not require serializing the types
2014-06-13 10:20:54 -06:00