Class: Flex::Tasks

Inherits:
Object
  • Object
show all
Defined in:
lib/flex/model_tasks.rb

Direct Known Subclasses

ModelTasks

Instance Method Summary collapse

Instance Method Details

#config_hashObject



9
10
11
12
13
14
15
16
17
18
# File 'lib/flex/model_tasks.rb', line 9

def config_hash
  @config_hash ||= begin
                     default = {}.extend Struct::Mergeable
                     (Conf.flex_models + Conf.flex_active_models).each do |m|
                       m = eval"::#{m}" if m.is_a?(String)
                       default.deep_merge! m.flex.default_mapping
                     end
                     default.deep_merge(original_config_hash)
                   end
end

#original_config_hashObject

patches the Flex::Tasks#config_hash so it evaluates also the default mapping for models it modifies also the index:create task



8
# File 'lib/flex/model_tasks.rb', line 8

alias_method :original_config_hash, :config_hash