fix undefined local variable
This commit is contained in:
parent
50cebdcb23
commit
cf57348c45
|
@ -4,20 +4,22 @@ module Impressionist
|
|||
def self.included(base)
|
||||
# include attr_accessible base on
|
||||
# rails version
|
||||
@klass = base
|
||||
should_include?
|
||||
base.
|
||||
belongs_to(:impressionable,:polymorphic => true)
|
||||
base.belongs_to(:impressionable,:polymorphic => true)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
attr_reader :klass
|
||||
|
||||
def self.should_include?
|
||||
toggle = Impressionist::RailsToggle.new(Rails::VERSION::MAJOR)
|
||||
self.include_attr_accessible unless toggle.valid?
|
||||
end
|
||||
|
||||
def self.include_attr_accessible
|
||||
base.attr_accessible(:impressionable_type,:impressionable_id,
|
||||
klass.attr_accessible(:impressionable_type,:impressionable_id,
|
||||
:user_id,:controller_name,:action_name,:view_name,:request_hash,
|
||||
:ip_address,:session_hash,:message,:referrer)
|
||||
|
||||
|
|
Loading…
Reference in New Issue