karmi / tire-contrib

Additions and extensions for the Tire gem
MIT License
65 stars 31 forks source link

Dynamic attribs #14

Closed davekinkead closed 11 years ago

davekinkead commented 11 years ago

Ok, so I've added this as a module Tire::Model::DynamicPersistence which needs to be included after persistence, ie:

include Tire::Model::Persistence
include Tire::Model::DynamicPersistence

Readme, tests, & updated gemspec included.

In addition to tests for the new functionality, I've also included all the persistence_model_tests from Tire to ensure no legacy behaviour breaks. I did have to change one test (see inline comments) but behaviour is still compatible. https://github.com/davekinkead/tire-contrib/blob/master/test/dynamic_persistence/model_persistence_test.rb#L261

Cheers,

Dave

karmi commented 11 years ago

Hi Dave, I've removed the ported tests, since it would be too hard to maintain them in sync, and retouched it a bit. Thanks!