Make associative_create_statement protected rather than private, so it can be accessed by subclasses. This makes it easy for subclasses to add custom fields to the impression.

This commit is contained in:
Peter M. Goldstein 2013-09-22 11:43:59 -07:00
parent 6ff77290f2
commit 68ea36a7fe
1 changed files with 15 additions and 13 deletions

View File

@ -38,6 +38,21 @@ module ImpressionistController
end end
end end
protected
# creates a statment hash that contains default values for creating an impression via an AR relation.
def associative_create_statement(query_params={})
query_params.reverse_merge!(
:controller_name => controller_name,
:action_name => action_name,
:user_id => user_id,
:request_hash => @impressionist_hash,
:session_hash => session_hash,
:ip_address => request.remote_ip,
:referrer => request.referer
)
end
private private
def bypass def bypass
@ -62,19 +77,6 @@ module ImpressionistController
end end
end end
# creates a statment hash that contains default values for creating an impression via an AR relation.
def associative_create_statement(query_params={})
query_params.reverse_merge!(
:controller_name => controller_name,
:action_name => action_name,
:user_id => user_id,
:request_hash => @impressionist_hash,
:session_hash => session_hash,
:ip_address => request.remote_ip,
:referrer => request.referer
)
end
# creates a statment hash that contains default values for creating an impression. # creates a statment hash that contains default values for creating an impression.
def direct_create_statement(query_params={}) def direct_create_statement(query_params={})
query_params.reverse_merge!( query_params.reverse_merge!(