Sha256: 241a206c96418d823898d6566b8c75f378480057caa1e2afb2d21ce4d6b4a91d
Contents?: true
Size: 692 Bytes
Versions: 7
Compression:
Stored size: 692 Bytes
Contents
module Slugged module Generators class SlugMigrationGenerator < Rails::Generators::NamedBase include Rails::Generators::Migration def self.source_root @_ps_source_root ||= File.expand_path("templates", File.dirname(__FILE__)) end def self.next_migration_number(dirname) #:nodoc: if ActiveRecord::Base.timestamped_migrations Time.now.utc.strftime("%Y%m%d%H%M%S") else "%.3d" % (current_migration_number(dirname) + 1) end end def create_migration_file migration_template "migration.erb", "db/migrate/add_cached_slug_to_#{table_name}.rb" end end end end
Version data entries
7 entries across 7 versions & 1 rubygems