Sha256: cca42d35dc8b778b8ad39e5c443e25e6266e191a03cce9df22e2a0e1a9ee4a24
Contents?: true
Size: 551 Bytes
Versions: 39
Compression:
Stored size: 551 Bytes
Contents
module AssignableValues module ActiveRecord private def assignable_values_for(property, options = {}, &values) restriction_type = belongs_to_association?(property) ? Restriction::BelongsToAssociation : Restriction::ScalarAttribute restriction_type.new(self, property, options, &values) end def belongs_to_association?(property) reflection = reflect_on_association(property) reflection && reflection.macro == :belongs_to end end end ActiveRecord::Base.send(:extend, AssignableValues::ActiveRecord)
Version data entries
39 entries across 39 versions & 1 rubygems