Class: Alchemy::PgSearch::UpgradeGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Alchemy::PgSearch::UpgradeGenerator
- Defined in:
- lib/generators/alchemy/pg_search/upgrade/upgrade_generator.rb
Instance Method Summary collapse
Instance Method Details
#copy_migration_file ⇒ Object
14 15 16 17 |
# File 'lib/generators/alchemy/pg_search/upgrade/upgrade_generator.rb', line 14 def copy_migration_file = 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_config ⇒ Object
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 |