0

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?

mltsy
  • 5,344
  • 1
  • 30
  • 41
  • It does seem to be the case that dm-paperclip is calling this method, which is a method from dm-validations, and which apparently no longer exists as a public method or something... ? But I'm not sure what it's supposed to do, so I don't know how to write a fix for it. – mltsy Apr 12 '12 at 01:03

2 Answers2

0

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.

mltsy
  • 5,344
  • 1
  • 30
  • 41
0

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

Max
  • 1,423
  • 1
  • 14
  • 16