Module: Locomotive::Extensions::Site::FirstInstallation

Included in:
Site
Defined in:
app/models/locomotive/extensions/site/first_installation.rb

Instance Method Summary collapse

Instance Method Details

#create_first_one(attributes) ⇒ Object

only called during the installation workflow, just after the admin account has been created



7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/models/locomotive/extensions/site/first_installation.rb', line 7

def create_first_one(attributes)
  site = self.new(attributes)
   = Account.first
  site.memberships.build account: , role: 'admin'

  site.save

  .locale = site.default_locale
  .save

  site
end