Class: Alchemy::PgSearch::UpgradeGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/alchemy/pg_search/upgrade/upgrade_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_migration_fileObject



14
15
16
17
# File 'lib/generators/alchemy/pg_search/upgrade/upgrade_generator.rb', line 14

def copy_migration_file
  timestamp = Time.now.strftime('%Y%m%d%H%M%S')
  copy_file "migration.rb.tt", Rails.root.join("db/migrate/#{timestamp}_upgrade_from_alchemy_ferret.alchemy_pg_search.rb")
end

#replace_element_configObject



9
10
11
12
# File 'lib/generators/alchemy/pg_search/upgrade/upgrade_generator.rb', line 9

def replace_element_config
  gsub_file Rails.root.join('config/alchemy/elements.yml'),
    'do_not_index: true', 'searchable: false'
end