Class: CreateRatingCaches
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- CreateRatingCaches
- Defined in:
- lib/generators/letsrate/templates/cache_migration.rb
Class Method Summary collapse
Class Method Details
.down ⇒ Object
15 16 17 |
# File 'lib/generators/letsrate/templates/cache_migration.rb', line 15 def self.down drop_table :rating_caches end |
.up ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/generators/letsrate/templates/cache_migration.rb', line 3 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. end add_index :rating_caches, [:cacheable_id, :cacheable_type] end |