lib/generators/effective/views_generator.rb in effective_developer-0.5.5 vs lib/generators/effective/views_generator.rb in effective_developer-0.6.0
- old
+ new
@@ -14,9 +14,13 @@
desc 'Creates views in your app/views folder.'
argument :actions, type: :array, default: ['crud'], banner: 'action action'
class_option :attributes, type: :array, default: [], desc: 'Included form attributes, otherwise read from model'
+ def validate_resource
+ exit unless resource_valid?
+ end
+
def assign_attributes
@attributes = (invoked_attributes.presence || resource_attributes).except(:archived)
self.class.send(:attr_reader, :attributes)
end