Class: DefaultSiteOptionsMigration

Inherits:
Migration
  • Object
show all
Defined in:
lib/yodel/models/migrations/08_default_site_options.rb

Class Method Summary collapse

Methods inherited from Migration

copy_missing_migrations_for_all_sites, copy_missing_migrations_for_site, inherited, run_migrations, run_migrations_for_all_sites

Class Method Details

.down(site) ⇒ Object



17
18
19
20
# File 'lib/yodel/models/migrations/08_default_site_options.rb', line 17

def self.down(site)
  site.options = {}
  site.save
end

.up(site) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/yodel/models/migrations/08_default_site_options.rb', line 2

def self.up(site)
  site.options = {
    pages: {
      permalink_character: {
        description: 'When Yodel creates a URL for a page by using the title of the page, there are sometimes characters (such as spaces) that need to be replaced. This character will be used in their place. e.g "About Us" would become "about-us".',
        type: 'String',
        default: '-',
        value: '-'
      }
    },
    icon: nil
  }
  site.save
end