Sha256: ee345847080374010a96e2964756cee44aed5301e41b2de2044a5dbc33b1a78c
Contents?: true
Size: 653 Bytes
Versions: 18
Compression:
Stored size: 653 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.each_key do |name| scope name, -> { where(property_name => name) } end end end end end
Version data entries
18 entries across 18 versions & 2 rubygems