Class: Site

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/site.rb

Class Method Summary collapse

Class Method Details

.by_host(host) ⇒ Object



20
21
22
# File 'app/models/site.rb', line 20

def by_host(host)
  Site.count == 1 ? Site.first : Site.find_by_host(host) # TODO [site detection] figure out how we want to do this ...
end

.install(params) ⇒ Object



12
13
14
15
16
17
18
# File 'app/models/site.rb', line 12

def install(params)
  User.skip_callbacks do # TODO [user dependency] move to adva-user
    site = Site.create!(params[:site])
    site..users.first.confirm!
    site
  end
end