Class: CreateSettings

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/tkh_admin_panel/create_or_update_migrations/templates/create_settings.rb

Class Method Summary collapse

Class Method Details

.downObject



17
18
19
20
# File 'lib/generators/tkh_admin_panel/create_or_update_migrations/templates/create_settings.rb', line 17

def self.down
  drop_table :settings
  Setting.drop_translation_table!
end

.upObject



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/generators/tkh_admin_panel/create_or_update_migrations/templates/create_settings.rb', line 3

def self.up
  create_table :settings do |t|
    t.string :site_name
    t.string :site_tagline
    t.boolean :enable_comments_in_pages, default: false
    t.boolean :disable_blog, default: false
    t.string :blog_name
    t.string :blog_tagline
    t.boolean :enable_comments_in_blog, default: true
    t.timestamps
  end
  Setting.create_translation_table! :site_name => :string, :site_tagline => :string, :blog_name => :string, :blog_tagline => :string
end