Module: Landable::Seeds

Defined in:
lib/landable/seeds.rb

Class Method Summary collapse

Class Method Details

.seed(key) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/landable/seeds.rb', line 5

def self.seed(key)
  method_key = "seed_#{key}".to_sym
  if respond_to? method_key
    send method_key if ActiveRecord::Base.connection.schema_exists? "#{Landable.configuration.database_schema_prefix}landable"
  else
    fail NotImplementedError, "No seeds for key '#{key}'"
  end
end