Sha256: 208cff534b4a9699f540c31802bb4e9c8bfa4fd2d55a52896c126feb273586e3

Contents?: true

Size: 567 Bytes

Versions: 4

Compression:

Stored size: 567 Bytes

Contents

class UpdateBlogFieldsForAdminMigration < Migration
  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
  
  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
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
yodel_blog-0.0.7 lib/migrations/03_update_blog_fields_for_admin.rb
yodel_blog-0.0.4 lib/migrations/03_update_blog_fields_for_admin.rb
yodel_blog-0.0.2 lib/migrations/03_update_blog_fields_for_admin.rb
yodel_blog-0.0.1 lib/migrations/03_update_blog_fields_for_admin.rb