class TkhSearch::Generators::CreateOrUpdateMigrationsGenerator
Public Class Methods
next_migration_number(path)
click to toggle source
# File lib/generators/tkh_search/create_or_update_migrations/create_or_update_migrations_generator.rb, line 9 def self.next_migration_number(path) unless @prev_migration_nr @prev_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i else @prev_migration_nr += 1 end @prev_migration_nr.to_s end
Public Instance Methods
copy_migrations()
click to toggle source
# File lib/generators/tkh_search/create_or_update_migrations/create_or_update_migrations_generator.rb, line 18 def copy_migrations puts 'creating search migrations' migration_template "create_tkh_search_terms.rb", "db/migrate/create_tkh_search_terms.rb" migration_template "create_tkh_search_instances.rb", "db/migrate/create_tkh_search_instances.rb" migration_template "create_tkh_search_queries.rb", "db/migrate/create_tkh_search_queries.rb" migration_template "create_tkh_search_events.rb", "db/migrate/create_tkh_search_events.rb" migration_template "create_tkh_search_results.rb", "db/migrate/create_tkh_search_results.rb" migration_template "fix_dangerous_attributes.rb", "db/migrate/fix_dangerous_attributes.rb" end