Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 4.2.5 - conflict with a method creator #26

Open
Nikolay-Lipovtsev opened this issue Dec 25, 2015 · 2 comments
Open

Rails 4.2.5 - conflict with a method creator #26

Nikolay-Lipovtsev opened this issue Dec 25, 2015 · 2 comments

Comments

@Nikolay-Lipovtsev
Copy link

Gemfile

gem 'rails', '~> 4.2', '>= 4.2.5'
gem 'userstamp', :git => 'https://github.com/stricte/userstamp.git', :branch => 'rails4'

User model

class User < ActiveRecord::Base
  ...
  model_stamper
  stampable
  ...
end

I have this message

You tried to define an association named creator on the model User, but this will conflict with a method creator already defined by Active Record. Please choose a different association name. (ArgumentError)

How I can fix it?

@Nikolay-Lipovtsev
Copy link
Author

If I try to customize my stampable at User model like this:

user.rb

class User < ActiveRecord::Base 
  ...
  model_stamper 
  acts_as_stampable :stamper_class_name => :person, 
                                  :creator_attribute => :create_user, 
                                  :updater_attribute => :update_user, 
                                  :deleter_attribute => :delete_user 
  ...
end

I get this error:

undefined method acts_as_stampable' for #<Class:0x007fe0db3dd010>

@joshmosh
Copy link

joshmosh commented Nov 30, 2016

@Nikolay-Lipovtsev you should be able to fix by changing acts_as_stampable to stampable.

For example:

class User < ActiveRecord::Base 
  ...
  model_stamper 
  stampable :stamper_class_name => :person,
                     :creator_attribute => :create_user,
                     :updater_attribute => :update_user,
                     :deleter_attribute => :delete_user
  ...
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants