Implement Event Ratings
This commit is contained in:
parent
5be1ad52ee
commit
20f4853487
67 changed files with 1298 additions and 378 deletions
17
db/migrate/20160922205550_create_rating_caches.rb
Normal file
17
db/migrate/20160922205550_create_rating_caches.rb
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
class CreateRatingCaches < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :rating_caches do |t|
|
||||
t.belongs_to :cacheable, polymorphic: true
|
||||
t.float :avg, null: false
|
||||
t.integer :qty, null: false
|
||||
t.string :dimension
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :rating_caches, [:cacheable_id, :cacheable_type]
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :rating_caches
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue