Module: Allinone::Core
- Defined in:
- lib/allinone.rb,
lib/allinone/core.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
3 4 5 |
# File 'lib/allinone/core.rb', line 3 def self.included(base) base.extend Allinone::Core::ClassMethods end |
Instance Method Details
#current_site ⇒ Object
7 8 9 |
# File 'lib/allinone/core.rb', line 7 def current_site RequestStore.store[:current_site] end |
#set_current_site ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/allinone/core.rb', line 11 def set_current_site if Rails.env.test? current_site = "" #set a default, passed from the app controller else current_site = Allinone::SiteSelector.new(request.host).fetch end site_not_found_handler unless current_site RequestStore.store[:current_site] = current_site end |
#site_not_found_handler ⇒ Object
23 24 25 |
# File 'lib/allinone/core.rb', line 23 def site_not_found_handler render :text => 'Site not Found' end |