<commit_before>h1. HasViewCount

h3. Adds a polymorphic association that allows any model to have a unique visitor count (based on IP address)
	


h2. Installation

<pre><code>
script/plugin install git://github.com/citrus/has_view_count.git
- or -
git submodule add git://github.com/citrus/has_view_count.git vendor/plugins/has_view_count

script/generate has_view_count
rake db:migrate
restart mongrel
</code></pre>
		
_This will generate_
		
<pre><code>
db/migrate/XXXXXXXXXXXXXX_has_view_count_migration.rb
app/models/view_count.rb
</code></pre>


***************************************************************************	

h2. Example


h4. Model:

<pre><code>
class Post < ActiveRecord::Base
  has_view_count
end
</code></pre>


h4. Controller:

<pre><code>
class PostsController < ApplicationController
	after_filter :record_view_count, :only => :show
	...
	...
	...
	private
  def record_view_count
  	@post.record_view_count(request.remote_ip, logged_in?) # use logged_in? if you have restful_authentication installed
  end
end
</code></pre>


_Copyright (c) 2009 Citrus Media Group / <NAME>, released under the MIT license_
<commit_msg>ready to rock and roll (and count views)<commit_after>h1. HasViewCount

h3. Adds a polymorphic association that allows any model to have a unique visitor count (based on IP address)
	


h2. Installation

<pre><code>script/plugin install git://github.com/citrus/has_view_count.git
- or -
git submodule add git://github.com/citrus/has_view_count.git vendor/plugins/has_view_count

script/generate has_view_count
rake db:migrate
restart mongrel
</code></pre>
		
_This will generate_
		
<pre><code>db/migrate/XXXXXXXXXXXXXX_has_view_count_migration.rb
app/models/view_count.rb
</code></pre>


***************************************************************************	

h2. Example


h4. Model:

<pre><code>class Post < ActiveRecord::Base
  has_view_count
end
</code></pre>


h4. Controller:

<pre><code>class PostsController < ApplicationController
	after_filter :record_view_count, :only => :show
	...
	...
	...
	private
  def record_view_count
  	@post.record_view_count(request.remote_ip, logged_in?) # use logged_in? if you have restful_authentication installed
  end
end
</code></pre>


_Copyright (c) 2009 Citrus Media Group / <NAME>, released under the MIT license_

{'fraction_non_alphanumeric': 0.16386373436826218, 'fraction_numerical': 0.008624407072013798, 'mean_word_length': 4.888324873096447, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5153376', 'n_tokens_mistral': 780, 'n_tokens_neox': 738, 'n_words': 193}