Sha256: 6a56559d76c46839e6da2d82bb5406717a679eb52d44f20d536a0ad6e672c159

Contents?: true

Size: 667 Bytes

Versions: 7

Compression:

Stored size: 667 Bytes

Contents

module Slugged
  module Generators
    class SlugsGenerator < Rails::Generators::Base
      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/create_slugged_slugs.rb"
      end
      
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
slugged-2.0.0 lib/generators/slugged/slugs/slugs_generator.rb
slugged-1.1.0 lib/generators/slugged/slugs/slugs_generator.rb
slugged-1.0.1 lib/generators/slugged/slugs/slugs_generator.rb
slugged-1.0.0 lib/generators/slugged/slugs/slugs_generator.rb
slugged-0.4.0 lib/generators/slugged/slugs/slugs_generator.rb
slugged-0.3.3 lib/generators/slugged/slugs/slugs_generator.rb
slugged-0.3.2 lib/generators/slugged/slugs/slugs_generator.rb