Skip to content

Instantly share code, notes, and snippets.

@mculp
Created October 3, 2012 07:12
Show Gist options
  • Save mculp/3825529 to your computer and use it in GitHub Desktop.
Save mculp/3825529 to your computer and use it in GitHub Desktop.
if ENV['BONSAI_INDEX_URL']
Tire.configure do
url "http://index.bonsai.io"
end
BONSAI_INDEX_NAME = ENV['BONSAI_INDEX_URL'][/[^\/]+$/]
else
app_name = Rails.application.class.parent_name.underscore.dasherize
app_env = Rails.env
BONSAI_INDEX_NAME = "#{app_name}-#{app_env}"
end
module Searchable
extend ActiveSupport::Concern
included do
include Tire::Model::Search
include Tire::Model::Callbacks
index_name BONSAI_INDEX_NAME
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment