Class: UpdateBlogFieldsForAdminMigration

Inherits:
Migration
  • Object
show all
Defined in:
lib/migrations/03_update_blog_fields_for_admin.rb

Class Method Summary collapse

Class Method Details

.down(site) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/migrations/03_update_blog_fields_for_admin.rb', line 12

def self.down(site)
  site.blogs.modify do |blogs|
    blogs.modify_field :articles_per_page, section: nil
  end
  
  site.articles.modify do |articles|
    articles.modify_field :author, show_blank: false, blank_text: nil
  end
end

.up(site) ⇒ Object



2
3
4
5
6
7
8
9
10
# File 'lib/migrations/03_update_blog_fields_for_admin.rb', line 2

def self.up(site)
  site.blogs.modify do |blogs|
    blogs.modify_field :articles_per_page, section: 'Options'
  end
  
  site.articles.modify do |articles|
    articles.modify_field :author, show_blank: true, blank_text: 'None'
  end
end