lib/generators/faalis/scaffold_generator.rb in faalis-1.0.0.alpha2 vs lib/generators/faalis/scaffold_generator.rb in faalis-1.0.0.alpha3
- old
+ new
@@ -97,19 +97,25 @@
relations << " validates_attachment_content_type :#{name},
content_type: %w(image/jpeg image/jpg image/png),
less_than: 1.megabytes\n"
# TODO: Run this generator just once for all images
`rails generate paperclip #{resource_data['name']} #{name}`
+
when 'tag'
rake "rake acts_as_taggable_on_engine:install:migrations"
relations << " acts_as_taggable_on :#{name}\n"
result << [name, 'string']
when 'in'
result << [name, 'string']
when 'has_and_belongs_to_many'
relations << " has_and_belongs_to_many :#{to.pluralize}\n"
+ say_status 'warn', "There is a many to many relation between #{resource_data['name']} and #{to},
+ You should create it manually in model files"
+
+ when 'has_many'
+ relations << " has_many :#{to.pluralize}\n"
say_status 'warn', "There is a many to many relation between #{resource_data['name']} and #{to},
You should create it manually in model files"
end
end