ensl.org/app/models/view_count.rb
Ari Timonen e59e8ac8e7 Lots of rails 4 updates
- Add .params to models and update controllers
- Add afk time to gather
- Reannotate models
- Fix rspec problem by using latest rspec plugins from github
2020-03-18 05:38:17 +02:00

20 lines
514 B
Ruby

# == Schema Information
#
# Table name: view_counts
#
# id :integer not null, primary key
# ip_address :string(255)
# logged_in :boolean
# viewable_type :string(255)
# created_at :date
# viewable_id :integer
#
# Indexes
#
# index_view_counts_on_viewable_type_and_viewable_id (viewable_type,viewable_id)
#
class ViewCount < ActiveRecord::Base
belongs_to :viewable, :polymorphic => true
validates_uniqueness_of :ip_address, :scope => [ :viewable_id, :viewable_type ]
end