Sha256: ffcfa84674cccee89e76b05415a49aae2eec7ba56271452892b3a3b032977793

Contents?: true

Size: 514 Bytes

Versions: 26

Compression:

Stored size: 514 Bytes

Contents

module Locomotive
  module Extensions
    module Site
      module FirstInstallation

        # only called during the installation workflow, just after the admin account has been created
        def create_first_one(attributes)
          site = self.new(attributes)
          account = Account.first
          site.memberships.build account: account, role: 'admin'

          site.save

          account.locale = site.default_locale
          account.save

          site
        end

      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
locomotive_cms-2.5.7 app/models/locomotive/extensions/site/first_installation.rb
locomotive_cms-2.5.6 app/models/locomotive/extensions/site/first_installation.rb
locomotive_cms-2.5.6.rc2 app/models/locomotive/extensions/site/first_installation.rb
locomotive_cms-2.5.6.rc1 app/models/locomotive/extensions/site/first_installation.rb
locomotive_cms-2.5.5 app/models/locomotive/extensions/site/first_installation.rb
locomotive_cms-2.5.4 app/models/locomotive/extensions/site/first_installation.rb
locomotive_cms-2.5.3 app/models/locomotive/extensions/site/first_installation.rb
locomotive_cms-2.5.2 app/models/locomotive/extensions/site/first_installation.rb
locomotive_cms-2.5.1 app/models/locomotive/extensions/site/first_installation.rb
locomotive_cms-2.5.0 app/models/locomotive/extensions/site/first_installation.rb
locomotive_cms-2.5.0.rc3 app/models/locomotive/extensions/site/first_installation.rb
locomotive_cms-2.5.0.rc2 app/models/locomotive/extensions/site/first_installation.rb
locomotive_cms-2.5.0.rc1 app/models/locomotive/extensions/site/first_installation.rb
locomotive_cms-2.4.1 app/models/locomotive/extensions/site/first_installation.rb
locomotive_cms-2.4.0 app/models/locomotive/extensions/site/first_installation.rb
locomotive_cms-2.3.1 app/models/locomotive/extensions/site/first_installation.rb
locomotive_cms-2.3.0 app/models/locomotive/extensions/site/first_installation.rb
locomotive_cms-2.2.3 app/models/locomotive/extensions/site/first_installation.rb
locomotive_cms-2.2.2 app/models/locomotive/extensions/site/first_installation.rb
locomotive_cms-2.2.1 app/models/locomotive/extensions/site/first_installation.rb