Merge pull request #223 from dancinglightning/master

small doc fix for readme step 4
This commit is contained in:
John McAliley 2017-03-10 12:35:33 -05:00 committed by GitHub
commit 62299d195f
1 changed files with 6 additions and 5 deletions

View File

@ -91,9 +91,10 @@ Usage
controller if you are using this method. If you add "impressionist" to the controller if you are using this method. If you add "impressionist" to the
top of your controller and also use this method in your action, it will top of your controller and also use this method in your action, it will
result in 2 impressions being logged (but associated with one request_hash). result in 2 impressions being logged (but associated with one request_hash).
If you're using [friendly_id](https://github.com/norman/friendly_id) be sure If you're using [friendly_id](https://github.com/norman/friendly_id) be sure
to log impressionist this way, as params[:id] will return a string(url slug) to log impressionist this way, as params[:id] will return a string(url slug)
while impressionable_id is a Integer column in database. while impressionable_id is a Integer column in database. Also note that you
have to take step #3 for the Widget model for this to work.
def show def show
@widget = Widget.find @widget = Widget.find
@ -119,7 +120,7 @@ Usage
in turn will give you impressions with unique params. in turn will give you impressions with unique params.
@widget.impressionist_count(:filter => :params) @widget.impressionist_count(:filter => :params)
8. Get the unique impression count from a model filtered by session hash. Same 8. Get the unique impression count from a model filtered by session hash. Same
as #6 regarding request hash. This may be more desirable than filtering by as #6 regarding request hash. This may be more desirable than filtering by
IP address depending on your situation, since filtering by IP may ignore IP address depending on your situation, since filtering by IP may ignore
@ -188,7 +189,7 @@ impressions in your controller:
# only record impression if session is unique # only record impression if session is unique
impressionist :unique => [:session_hash] impressionist :unique => [:session_hash]
# only record impression if param is unique # only record impression if param is unique
impressionist :unique => [:params] impressionist :unique => [:params]