lib/katapult/model.rb in katapult-0.1.2 vs lib/katapult/model.rb in katapult-0.2.0
- old
+ new
@@ -20,10 +20,22 @@
def attr(attr_name, options = {})
attrs << Attribute.new(attr_name, options)
end
def label_attr
- attrs.first
+ renderable_attrs.first
+ end
+
+ def db_fields
+ attrs.reject(&:skip_db)
+ end
+
+ def renderable_attrs
+ attrs.reject { |a| %w[plain_json json password].include? a.type.to_s }
+ end
+
+ def editable_attrs
+ attrs.reject { |a| %w[plain_json json].include? a.type.to_s }
end
def render
Generators::ModelGenerator.new(self).invoke_all
end