Sha256: 274ada9e2b72c5f22c9d9ccbbcde938d8966ac6042dcac481f518e2f1fbd0487
Contents?: true
Size: 665 Bytes
Versions: 43
Compression:
Stored size: 665 Bytes
Contents
module ActiveGraph::Node module Enum extend ActiveSupport::Concern include ActiveGraph::Shared::Enum module ClassMethods protected def define_property(property_name, *args) super ActiveGraph::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
43 entries across 43 versions & 1 rubygems