Class: Goldencobra::Domain
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Goldencobra::Domain
- Defined in:
- app/models/goldencobra/domain.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.current ⇒ Object
29 30 31 |
# File 'app/models/goldencobra/domain.rb', line 29 def self.current Thread.current[:current_client] end |
.current=(ccl) ⇒ Object
33 34 35 |
# File 'app/models/goldencobra/domain.rb', line 33 def self.current=(ccl) Thread.current[:current_client] = ccl end |
.main ⇒ Object
16 17 18 |
# File 'app/models/goldencobra/domain.rb', line 16 def self.main Goldencobra::Domain.where(main: true).first end |
Instance Method Details
#mark_as_main ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'app/models/goldencobra/domain.rb', line 20 def mark_as_main if self.main == true Goldencobra::Domain.where("id <> #{self.id.to_i}").each do |a| a.main = false a.save end end end |