Module: AdjustableSchema::Config

Includes:
Memery
Defined in:
lib/adjustable_schema/config.rb

Overview

:nodoc:

Defined Under Namespace

Modules: Naming

Class Method Summary collapse

Class Method Details

.association_namesObject



79
# File 'lib/adjustable_schema/config.rb', line 79

def association_names = Engine.config.names[:associations]

.find_directionObject



62
63
64
65
# File 'lib/adjustable_schema/config.rb', line 62

def find_direction(...)
	normalize(...)
			.find { |dir, *| dir.in? association_directions }
end

.normalize(**options) ⇒ Object



81
82
83
84
85
86
87
88
# File 'lib/adjustable_schema/config.rb', line 81

def normalize **options
	shortcuts
			.tap { options.assert_valid_keys it.keys, it.values }
			.select { _2.in? options }
			.each { options[_1] = options.delete _2 }

	options
end