Implement Event Ratings
This commit is contained in:
parent
5be1ad52ee
commit
20f4853487
67 changed files with 1298 additions and 378 deletions
18
db/migrate/20160922205551_create_rates.rb
Normal file
18
db/migrate/20160922205551_create_rates.rb
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
class CreateRates < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :rates do |t|
|
||||
t.belongs_to :rater
|
||||
t.belongs_to :rateable, polymorphic: true
|
||||
t.float :stars, null: false
|
||||
t.string :dimension
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :rates, :rater_id
|
||||
add_index :rates, [:rateable_id, :rateable_type]
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :rates
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue