- Add dm-sqlite-adapter back to Gemfile: Needed for testing. - Remove dm-validations from gemspec: 1. Otherwise bundler will always load it, breaking data_mapper_active_model 2. It's not strictly needed (because data_mapper_active_model is an option) and I think it's safe to assume any app wanting to use dm-validations will already have it in the app's Gemfile. - Remove warden dependency from Rakefile (used to generate gemspec)
Thanks to kristianmandrup http://github.com/kristianmandrup/mm-devise/commit/51fe50f
…ed from git
…tions The benefit is ActiveModel's I18n support and consistency with other devise ORMs (only 1 test override--check for DateTime v. Time, instead of 4 for regular data_mapper ORM) The downside is that you can't have dm-validations ever required in your application, and that means no auto-validations. A few specific changes of note: - Ensure Resource#save does a valid? check. This doesn't automatically happen with ActiveModel validations in a DM resource. I haven't looked into why. - Break up overrides_test into tests applicable to both validation libs and those specific to using dm-validations -
I decided not to go the i18n route for now, since I wasn't happy with it (and since it's not what DM users would expect). Instead, I just set default_error_messages= to return the messages devise expects (with a monkey-patch to ValidationErrors#add to allow it to accept a Symbol argument). There were four tests that weren't passing, but all for what I feel are unimportant reasons, so I've overriden them in test/overrides_test.rb with DM-specific expectations. I'm not sure the method I've used for testing (as far as running devise's testsuite) is ideal, but it works.