minimapper
minimapper copied to clipboard
A minimalistic way of separating your models from ActiveRecord
Locked down to pre-4.0 in https://github.com/joakimk/minimapper/commit/6d9352e4dbb0c2362a0159bf098cc14e7a014686 to solve https://travis-ci.org/joakimk/minimapper/jobs/12124380
When we have time, or if anyone wants to contribute. Pull in, test and cleanup the extensions from https://gist.github.com/joakimk/5656945 to support such things as callbacks and nested includes.
Current behaviour: ``` ruby class MyEntity include Minimapper::Entity attribute :my_attrib attr_accessor :my_accessor end e = MyEntity.new(my_attrib: 1, my_accessor: 2) e.attributes # => { my_attrib: 1, my_accessor: 2 } ``` Expected...
Now only support `find`
Namely: say the mapper copies timestamp x from record to entity. Later, at timestamp y, we modify it and ask the mapper to persist it from entity to record. We...
Failing test includes ``` class TestAgedUser < TestUser attributes :age end it "inherits attributes" do TestAgedUser.column_names.should == [ "id", "created_at", "updated_at", "name", "age" ] end ``` We can't use a...
The timestamp columns aren't guaranteed to exist in an ActiveRecord class. Maybe we could have a method called something like `timestamp_attributes` that adds those attributes. Cf. `t.timestamps` in migrations. As...