backflip 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/backflip/version.rb +1 -1
- data/lib/backflip.rb +2 -2
- metadata +1 -1
data/lib/backflip/version.rb
CHANGED
data/lib/backflip.rb
CHANGED
@@ -52,7 +52,7 @@ module ActiveRecord
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def self.generate_migrations
|
55
|
-
puts "rails g
|
55
|
+
puts "rails g model #{self.name.underscore} #{@@attributes.join(' ')} #{@@supporting_attributes.join(' ')} --skip"
|
56
56
|
@@migrations.each do |migration|
|
57
57
|
puts migration
|
58
58
|
end
|
@@ -68,7 +68,7 @@ module Backflip
|
|
68
68
|
desc "generate FILE", "generate migrations required for a given model file"
|
69
69
|
def generate(filename)
|
70
70
|
begin
|
71
|
-
require filename
|
71
|
+
require "./#{filename}"
|
72
72
|
filename.split(/\//).last.gsub(/\.rb/, '').classify.constantize.generate_migrations
|
73
73
|
rescue NameError
|
74
74
|
$stderr.print "Ah, there is a dependancy in this model that Backflip won't try to load.\nTry generating the migration before adding in all the goodies.\n\nHere's a hint for what the problem is:\n\n"
|