Sha256: c91801d47ce83fec9e98f352de1c99a61e5deaf34778b11fc75114085f86eca2
Contents?: true
Size: 518 Bytes
Versions: 50
Compression:
Stored size: 518 Bytes
Contents
module MongoModel module AttributeMethods module Query extend ActiveSupport::Concern included do attribute_method_suffix "?" end # Returns true if the attribute is not blank (i.e. it has some value). Otherwise returns false. def query_attribute(name) attributes.has?(name.to_sym) end private # Handle *? for method_missing. def attribute?(attribute_name) query_attribute(attribute_name) end end end end
Version data entries
50 entries across 50 versions & 1 rubygems