lib/saasable/mongoid/saas_document.rb in saasable-5.0.0 vs lib/saasable/mongoid/saas_document.rb in saasable-5.0.1

- old
+ new

@@ -53,10 +53,10 @@ def find_by_host! a_host if Saasable::Mongoid::SaasDocument.saas_document.nil? raise Saasable::Errors::NoSaasDocuments, "you need to set one Saasable::SaasDocument" end - possible_saas = Saasable::Mongoid::SaasDocument.saas_document.where(hosts: a_host.gsub(/^www\./, '')).to_a + possible_saas = Saasable::Mongoid::SaasDocument.saas_document.where(hosts: a_host).to_a if possible_saas.empty? raise Saasable::Errors::SaasNotFound, "no #{Saasable::Mongoid::SaasDocument.saas_document.name} found for the host: \"#{a_host}\"" elsif possible_saas.count > 1 raise Saasable::Errors::MultipleSaasFound, "more then 1 #{Saasable::Mongoid::SaasDocument.saas_document.name} found for the host: \"#{a_host}\"" else