Undefined method opts_from_validator_args

160 views Asked by At

I just tried updating a project to use DataMapper 1.2 (from 1.1) and now I'm getting this error:

/home/joe/.rvm/gems/ruby-1.9.2-p290@marketplace-admin/gems/dm-core-1.2.0/lib/dm-core/model/relationship.rb:372:in `method_missing': undefined method `opts_from_validator_args' for Category:Class (NoMethodError)

It's happening on a line where I call has_attached_file from dm-paperclip. I tried updating to dm-paperclip-r3, since the project is on Rails 3, but that didn't help.

Any ideas as to what might cause this error?

2

There are 2 answers

0
mltsy On BEST ANSWER

I was able to fix my situation by removing "config.use_dm_validations = true" from my paperclip initializer, so now it doesn't validate the extra paperclip fields, but at least it works. I'll have to wait for someone who knows more about the gems in question to update dm-paperclip to be compatible with dm-validations 1.2 before I can put it back in.

0
Max On

I managed, to make this gem working with validations. Here is the working brunch: https://github.com/kot-begemot/dm-paperclip/tree/fix_for_dm_1_2_0 Here i describe some obstacles: https://github.com/krobertson/dm-paperclip/issues/24

UPDATE:

Gem is fixed and tested. I send the pull request to creator. It should work without any problems now. check it out: https://github.com/kot-begemot/dm-paperclip/tree/fix_for_dm_1_2_0