forked from OpenNeo/impress
enable hangers in development, disable in production
This commit is contained in:
parent
71d9dc44cd
commit
9c6797699e
3 changed files with 8 additions and 3 deletions
|
@ -36,8 +36,10 @@ class ClosetHanger < ActiveRecord::Base
|
|||
|
||||
before_validation :merge_quantities, :set_owned_by_list
|
||||
|
||||
if Flex::Configuration.hangers_enabled
|
||||
flex.parent :item, 'item' => 'closet_hanger'
|
||||
flex.sync self
|
||||
end
|
||||
|
||||
def flex_source
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue