Sha256: a1886229c30eeb773fb5ac0608b89503fc6a68f5cace1f9d4f2aab8b259c5d6a
Contents?: true
Size: 621 Bytes
Versions: 42
Compression:
Stored size: 621 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) 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
42 entries across 42 versions & 1 rubygems