userstamp
userstamp copied to clipboard
Rails 4 not supported?
running tests now causes:
11:21:16 - INFO - Run all
11:21:16 - INFO - Running all specs
/home/nir0/.rvm/gems/ruby-2.0.0-p195@vsluh4dev/gems/activerecord-4.0.0/lib/active_record/dynamic_matchers.rb:22:in `method_missing': undefined method `class_inheritable_accessor' for ActiveRecord::Base:Class (NoMethodError)
from /home/nir0/.rvm/gems/ruby-2.0.0-p195@vsluh4dev/gems/userstamp-2.0.1/lib/stampable.rb:29:in `block in included'
from /home/nir0/.rvm/gems/ruby-2.0.0-p195@vsluh4dev/gems/userstamp-2.0.1/lib/stampable.rb:25:in `class_eval'
from /home/nir0/.rvm/gems/ruby-2.0.0-p195@vsluh4dev/gems/userstamp-2.0.1/lib/stampable.rb:25:in `included'
from /home/nir0/.rvm/gems/ruby-2.0.0-p195@vsluh4dev/gems/userstamp-2.0.1/lib/stampable.rb:154:in `include'
from /home/nir0/.rvm/gems/ruby-2.0.0-p195@vsluh4dev/gems/userstamp-2.0.1/lib/stampable.rb:154:in `<top (required)>'
from /home/nir0/.rvm/gems/ruby-2.0.0-p195@vsluh4dev/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
from /home/nir0/.rvm/gems/ruby-2.0.0-p195@vsluh4dev/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
from /home/nir0/.rvm/gems/ruby-2.0.0-p195@vsluh4dev/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
from /home/nir0/.rvm/gems/ruby-2.0.0-p195@vsluh4dev/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
from /home/nir0/.rvm/gems/ruby-2.0.0-p195@vsluh4dev/gems/userstamp-2.0.1/lib/userstamp.rb:2:in `<top (required)>'
from /home/nir0/.rvm/gems/ruby-2.0.0-p195@vsluh4dev/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
from /home/nir0/.rvm/gems/ruby-2.0.0-p195@vsluh4dev/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from /home/nir0/.rvm/gems/ruby-2.0.0-p195@vsluh4dev/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
from /home/nir0/.rvm/gems/ruby-2.0.0-p195@vsluh4dev/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
from /home/nir0/.rvm/gems/ruby-2.0.0-p195@vsluh4dev/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
from /home/nir0/.rvm/gems/ruby-2.0.0-p195@vsluh4dev/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
from /home/nir0/.rvm/gems/ruby-2.0.0-p195@vsluh4dev/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
from /home/nir0/projects/vsluh4/config/application.rb:7:in `<top (required)>'
from /home/nir0/projects/vsluh4/config/environment.rb:2:in `require'
from /home/nir0/projects/vsluh4/config/environment.rb:2:in `<top (required)>'
from /home/nir0/projects/vsluh4/spec/spec_helper.rb:3:in `require'
from /home/nir0/projects/vsluh4/spec/spec_helper.rb:3:in `<top (required)>'
from /home/nir0/projects/vsluh4/spec/models/post_spec.rb:1:in `require'
from /home/nir0/projects/vsluh4/spec/models/post_spec.rb:1:in `<top (required)>'
from /home/nir0/.rvm/gems/ruby-2.0.0-p195@vsluh4dev/gems/rspec-core-2.14.4/lib/rspec/core/configuration.rb:896:in `load'
from /home/nir0/.rvm/gems/ruby-2.0.0-p195@vsluh4dev/gems/rspec-core-2.14.4/lib/rspec/core/configuration.rb:896:in `block in load_spec_files'
from /home/nir0/.rvm/gems/ruby-2.0.0-p195@vsluh4dev/gems/rspec-core-2.14.4/lib/rspec/core/configuration.rb:896:in `each'
from /home/nir0/.rvm/gems/ruby-2.0.0-p195@vsluh4dev/gems/rspec-core-2.14.4/lib/rspec/core/configuration.rb:896:in `load_spec_files'
from /home/nir0/.rvm/gems/ruby-2.0.0-p195@vsluh4dev/gems/rspec-core-2.14.4/lib/rspec/core/command_line.rb:22:in `run'
from /home/nir0/.rvm/gems/ruby-2.0.0-p195@vsluh4dev/gems/rspec-core-2.14.4/lib/rspec/core/runner.rb:80:in `run'
from /home/nir0/.rvm/gems/ruby-2.0.0-p195@vsluh4dev/gems/rspec-core-2.14.4/lib/rspec/core/runner.rb:17:in `block in autorun'
appears when model_stamper is added into user model
Thanks for the tip. This worked for my Rails 4.1.5
raising ArgumentError by using stampable in any model
/[email protected]/gems/activerecord-4.1.5/lib/active_record/associations/builder/association.rb:30: in `build': You tried to define an association named creator on the model < any model name >, but this will conflict with a method creator already defined by Active Record. Please choose a different association name. (ArgumentError)
+1
If anybody have problem with association name conflict in Rails 4 use this:
gem 'userstamp', :git => 'https://github.com/stricte/userstamp.git', :branch => 'rails4'
and configure custom associations names with (see last three lines):
stampable :stamper_class_name => :person,
:creator_attribute => :created_by_person,
:updater_attribute => :updated_by_person,
:deleter_attribute => :deleted_by_person,
:creator_association => :person_creator,
:updater_association => :person_updater,
:deleter_association => :person_deleter
I have pushed this few minutes ago, so please test before use at production
+1