Method: Binda::FieldableAssociationHelpers::FieldableRelationHelpers#has_related_boards
- Defined in:
- app/models/concerns/binda/fieldable_association_helpers/fieldable_relation_helpers.rb
#has_related_boards(field_slug) ⇒ boolean
Check if has related boards
50 51 52 53 54 |
# File 'app/models/concerns/binda/fieldable_association_helpers/fieldable_relation_helpers.rb', line 50 def (field_slug) obj = self.relations.find{ |t| t.field_setting_id == FieldSetting.get_id( field_slug ) } raise ArgumentError, "There isn't any related field associated to the current slug (#{field_slug}) on instance (#{self.class.name} ##{self.id}).", caller if obj.nil? return obj.dependent_relations.any? end |