lib/generators/lookylu/state_generator.rb in looky-lu-0.0.1 vs lib/generators/lookylu/state_generator.rb in looky-lu-0.0.2
- old
+ new
@@ -7,11 +7,10 @@
source_root File.expand_path('../templates', __FILE__)
desc 'Build the state LU items'
class_option :model, :type => :boolean, :default => true, :desc => "Generate a default model object."
-
def generate_migration
if Dir.glob(migration_location('*')).empty?
template "states_migration.erb", migration_location(next_migration_number)
end
end
@@ -24,20 +23,20 @@
end
end
private
- def next_migration_number
- Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
- end
+ def next_migration_number
+ Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
+ end
- def migration_location version
- "db/migrate/#{version}_lookylu_create_#{plural_name}.rb"
- end
+ def migration_location version
+ "db/migrate/#{version}_lookylu_create_#{plural_name}.rb"
+ end
- def model_location
- "app/models/#{model_name}.rb"
- end
+ def model_location
+ "app/models/#{model_name}.rb"
+ end
end
end
end