lib/carload.rb in carload-0.4.1 vs lib/carload.rb in carload-0.4.2

- old
+ new

@@ -1,8 +1,13 @@ # Require all dependencies (Rails does not do this for us in default). Gem.loaded_specs['carload'].dependencies.each do |dependency| - require dependency.name + begin + require dependency.name + rescue LoadError + # For elasticsearch-model and elasticsearch-rails + require dependency.name.gsub('-', '/') + end end require 'carload/extended_hash' require 'carload/association_pipelines' require 'carload/model_spec' @@ -21,9 +26,13 @@ if not [:devise, :none].include? @@config[:auth_solution] raise UnsupportedError.new("authentication solution #{@@config[:auth_solution]}") end if not [:carrierwave].include? @@config[:upload_solution] raise UnsupportedError.new("upload solution #{@@config[:upload_solution]}") + end + @@config[:search_engine] ||= :elasticsearch + if not [:elasticsearch, :pg_search].include? @@config[:search_engine] + raise UnsupportedError.new("search engine #{@@config[:search_engine]}") end # Define configuation helpers. @@config.each do |key, value| define_singleton_method key do value