1
0
Fork 0
forked from OpenNeo/impress

enable hangers in development, disable in production

This commit is contained in:
Emi Matchu 2013-01-29 23:06:37 -06:00
parent 71d9dc44cd
commit 9c6797699e
3 changed files with 8 additions and 3 deletions

View file

@ -36,8 +36,10 @@ class ClosetHanger < ActiveRecord::Base
before_validation :merge_quantities, :set_owned_by_list
flex.parent :item, 'item' => 'closet_hanger'
flex.sync self
if Flex::Configuration.hangers_enabled
flex.parent :item, 'item' => 'closet_hanger'
flex.sync self
end
def flex_source
{

View file

@ -193,7 +193,8 @@ class Item
raise Item::Search::Error, message
end
if key == :user_closet_hanger_ownership
if (!Flex::Configuration.hangers_enabled &&
key == :user_closet_hanger_ownership)
Item::Search.error 'user_filters_disabled'
end

View file

@ -17,6 +17,8 @@ Flex::Configuration.configure do |config|
# The custom url of your ElasticSearch server
config.base_uri = 'http://impress.openneo.net:9200' if Rails.env.production?
config.hangers_enabled = !Rails.env.production?
# Set it to true to log the debug infos (true by default in development mode)
# config.debug = false