Method: Elastify::Model#mapping_file
- Defined in:
- lib/elastify/model.rb
#mapping_file(file_name) ⇒ Object
17 18 19 20 |
# File 'lib/elastify/model.rb', line 17 def mapping_file(file_name) file_path = file_name.instance_of?(Pathname) ? file_name : Rails.root.join('config', 'elastify', 'mappings', file_name) @opt_mapping = JSON.parse(File.read(file_path)).deep_symbolize_keys if File.exist?(file_path) end |