lib/generators/katapult/app_model/templates/lib/katapult/application_model.rb in katapult-0.3.0 vs lib/generators/katapult/app_model/templates/lib/katapult/application_model.rb in katapult-0.4.0
- old
+ new
@@ -11,9 +11,12 @@
# The order of attributes is respected when generating the form for that model
product.attr :price, type: :money
product.attr :mode, assignable_values: %w[public private]
product.attr :provider, type: :url
product.attr :import_data, type: :json
+
+ # Reference other models just like you called them
+ product.belongs_to 'user'
end
# Define a model
model 'user' do |user|
user.attr :email # Type "email" derived from attribute name