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