Hi! I have a problem with rolify+paper_trail. My role model:
class Role < ActiveRecord::Base
has_paper_trail
scopify
has_and_belongs_to_many :user_company_memberships, :join_table => :user_company_memberships_roles
belongs_to :resource, :polymorphic => true
validates :resource_type, :inclusion => { :in => Rolify.resource_types }, :allow_nil => true
validates :name, presence: true, uniqueness: true, length: {:in => 2..30}
end
Trying to create a role:
Role.create(name: 'admin')
NameError: uninitialized constant Role::Resource
from /usr/local/lib/ruby/gems/2.2.0/gems/activerecord-4.2.1/lib/active_record/inheritance.rb:158:in `compute_type'
But without has_paper_trail it works just fine.
Rails 4.2.1