Sha256: 1d09f413b1d57b9f3b35420af0d92e9c9b12751b4df9a75b3fb292bd4039525d
Contents?: true
Size: 760 Bytes
Versions: 13
Compression:
Stored size: 760 Bytes
Contents
require 'rails/generators' require "rails/generators/active_record" class FriendlyIdMobilityGenerator < ::Rails::Generators::Base include ::Rails::Generators::Migration desc "Generates migration to add locale column to friendly_id_slugs table." source_root File.expand_path('../templates', __FILE__) def self.next_migration_number(dirname) ::ActiveRecord::Generators::Base.next_migration_number(dirname) end def create_migration_file template = "add_locale_to_friendly_id_slugs" migration_dir = File.expand_path("db/migrate") if self.class.migration_exists?(migration_dir, template) ::Kernel.warn "Migration already exists." else migration_template "migration.rb", "db/migrate/#{template}.rb" end end end
Version data entries
13 entries across 13 versions & 1 rubygems