Sha256: f0d8f624248ce5477fbf6828dbbbf7176f05e6e264e500809977fdf123162e43

Contents?: true

Size: 466 Bytes

Versions: 12

Compression:

Stored size: 466 Bytes

Contents

class LockerGenerator < Rails::Generators::NamedBase
  include Rails::Generators::Migration

  source_root File.expand_path('../templates', __FILE__)
  argument :name, :type => :string, :default => "Lock"

  def self.next_migration_number(path)
    Time.now.utc.strftime("%Y%m%d%H%M%S")
  end

  def create_locker_files
    migration_template "migration.rb", "db/migrate/create_#{plural_name}.rb"
    template "model.rb", "app/models/#{singular_name}.rb"
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
locker-0.6.0 lib/generators/locker/locker_generator.rb
locker-0.5.0 lib/generators/locker/locker_generator.rb
locker-0.4.0 lib/generators/locker/locker_generator.rb
locker-0.3.2 lib/generators/locker/locker_generator.rb
locker-0.3.1 lib/generators/locker/locker_generator.rb
locker-0.3.0 lib/generators/locker/locker_generator.rb
locker-0.2.1 lib/generators/locker/locker_generator.rb
locker-0.2.0 lib/generators/locker/locker_generator.rb
locker-0.1.0 lib/generators/locker/locker_generator.rb
locker-0.0.3 lib/generators/locker/locker_generator.rb
locker-0.0.2 lib/generators/locker/locker_generator.rb
locker-0.0.1 lib/generators/locker/locker_generator.rb