Sha256: 40c1100022e5cfc0d7f1714381ec1e245b1d07bf1ead723f6161cf6e87e39b52
Contents?: true
Size: 490 Bytes
Versions: 26
Compression:
Stored size: 490 Bytes
Contents
module HydraEditor class FieldMetadataService # If the field is a reflection, delegate to the reflection. # If the field is a property, delegate to the property. # Otherwise return false def self.multiple?(model_class, field) if reflection = model_class.reflect_on_association(field) reflection.collection? elsif model_class.attribute_names.include?(field.to_s) model_class.multiple?(field) else false end end end end
Version data entries
26 entries across 26 versions & 1 rubygems