instance method migration_template

Ruby on Rails 2.3.18

Since v2.2.3 Last seen in v2.3.18

Available in: v2.2.3 v2.3.18

Signature

migration_template(relative_source, relative_destination, template_options = {})

When creating a migration, it knows to find the first available file in db/migrate and use the migration.rb template.

Parameters

relative_source req
relative_destination req
template_options opt = {}
Source
# File railties/lib/rails_generator/commands.rb, line 356
        def migration_template(relative_source, relative_destination, template_options = {})
          migration_directory relative_destination
          migration_file_name = template_options[:migration_file_name] || file_name
          raise "Another migration is already named #{migration_file_name}: #{existing_migrations(migration_file_name).first}" if migration_exists?(migration_file_name)
          template(relative_source, "#{relative_destination}/#{next_migration_string}_#{migration_file_name}.rb", template_options)
        end

Defined in railties/lib/rails_generator/commands.rb line 356 · View on GitHub · Improve this page · Find usages on GitHub

Defined in Rails::Generator::Commands::Create

Type at least 2 characters to search.

↑↓ navigate · open · esc close