Sha256: 95bae9d0b8d84acff75c53d0e2a249ea9628bfbaae53add6b0048530ab3b7b48
Contents?: true
Size: 654 Bytes
Versions: 32
Compression:
Stored size: 654 Bytes
Contents
module Neo4j::ActiveNode module Enum extend ActiveSupport::Concern include Neo4j::Shared::Enum module ClassMethods protected def define_property(property_name, *args) super Neo4j::ModelSchema.add_required_index(self, property_name) unless args[1][:_index] == false end def define_enum_methods(property_name, enum_keys, options) super define_enum_scopes(property_name, enum_keys) end def define_enum_scopes(property_name, enum_keys) enum_keys.keys.each do |name| scope name, -> { where(property_name => name) } end end end end end
Version data entries
32 entries across 32 versions & 1 rubygems