Class: Guts::Site
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Guts::Site
- Includes:
- TrackableConcern
- Defined in:
- app/models/guts/site.rb
Overview
Site model
Class Method Summary collapse
-
.current_id ⇒ Integer
Gets the current site ID.
-
.current_id=(id) ⇒ Object
Sets the current site ID.
Instance Method Summary collapse
-
#default? ⇒ Boolean
Checks if a site is default.
Class Method Details
.current_id ⇒ Integer
Note:
I simply can not see a better way at the moment to handle this with default_scope
Gets the current site ID
37 38 39 |
# File 'app/models/guts/site.rb', line 37 def self.current_id Thread.current[:site_id] end |
.current_id=(id) ⇒ Object
Note:
I simply can not see a better way at the moment to handle this with default_scope
Sets the current site ID
30 31 32 |
# File 'app/models/guts/site.rb', line 30 def self.current_id=(id) Thread.current[:site_id] = id end |
Instance Method Details
#default? ⇒ Boolean
Checks if a site is default
23 24 25 |
# File 'app/models/guts/site.rb', line 23 def default? self[:default] == true end |