app/models/binda/repeater.rb in binda-0.1.3 vs app/models/binda/repeater.rb in binda-0.1.4
- old
+ new
@@ -5,9 +5,12 @@
# Associations
belongs_to :fieldable, polymorphic: true
belongs_to :field_setting
+ validates :fieldable_id, presence: true
+ validates :fieldable_type, presence: true
+
# The following direct association is used to securely delete associated fields
# Infact via `fieldable` the associated fields might not be deleted
# as the fieldable_id is related to the `component` rather than the `field_setting`
after_create :set_default_position