Class: Ghost::Seeder::Models::SettingsSeed

Inherits:
GenericSeed
  • Object
show all
Defined in:
lib/ghost/seeder/models/settings_seed.rb

Instance Attribute Summary

Attributes inherited from GenericSeed

#attributes, #record

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from GenericSeed

#initialize, load_fixtures, perform_queries, yaml_bindings

Constructor Details

This class inherits a constructor from Ghost::Seeder::Models::GenericSeed

Class Method Details

.klassObject



8
9
10
# File 'lib/ghost/seeder/models/settings_seed.rb', line 8

def klass
  Setting
end

.seedsObject



12
13
14
15
16
17
# File 'lib/ghost/seeder/models/settings_seed.rb', line 12

def seeds
  super + [{
    key: "navigation",
    value: load_fixtures("navigation").to_json
  }]
end

.wipe_records!Object



19
20
21
# File 'lib/ghost/seeder/models/settings_seed.rb', line 19

def wipe_records!
  Logger.info "can't wipe", self
end

Instance Method Details

#seed!Object



24
25
26
27
# File 'lib/ghost/seeder/models/settings_seed.rb', line 24

def seed!
  setting.update!(value: record.value)
  Logger.success self.class, "#{record.key}:", record.value
end