Skip to content

Commit

Permalink
Merge pull request #19 from thekindofme/development
Browse files Browse the repository at this point in the history
Replace the buggy next_migration_number implementation with what ActiveR...
  • Loading branch information
muratguzel committed Feb 26, 2013
2 parents 1ecb68e + 44512ad commit f7a0b08
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions lib/generators/letsrate/letsrate_generator.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require 'rails/generators/migration'
class LetsrateGenerator < Rails::Generators::NamedBase
require 'rails/generators/active_record'
class LetsrateGenerator < ActiveRecord::Generators::Base
include Rails::Generators::Migration

source_root File.expand_path('../templates', __FILE__)
Expand Down Expand Up @@ -35,15 +36,5 @@ def create_cacheable_migration
desc "migration is creating ..."
def create_migration
migration_template "migration.rb", "db/migrate/create_rates.rb"
end


private
def self.next_migration_number(dirname)
if ActiveRecord::Base.timestamped_migrations
Time.now.utc.strftime("%Y%m%d%H%M%S%L")
else
"%.3d" % (current_migration_number(dirname) + 1)
end
end
end

0 comments on commit f7a0b08

Please sign in to comment.