Class: Decidim::Voca::Rpc::SeedAdmin

Inherits:
Object
  • Object
show all
Includes:
VocaDecidim
Defined in:
app/rpc/decidim/voca/rpc/seed_admin.rb

Constant Summary

Constants included from VocaDecidim

VocaDecidim::DecidimOrganizationColorSettings, VocaDecidim::DecidimOrganizationFeatureFlagSettings, VocaDecidim::DecidimOrganizationFileUploadSettings, VocaDecidim::DecidimOrganizationLocaleSettings, VocaDecidim::DecidimOrganizationNamingSettings, VocaDecidim::DecidimOrganizationPermissionSettings, VocaDecidim::DecidimOrganizationSMTPSettings, VocaDecidim::GetSettingsResponse, VocaDecidim::PingResponse, VocaDecidim::SETTINGS_MACHINE_TRANSLATION_PRIORITY_OPTION, VocaDecidim::SETTINGS_REGISTER_MODE_OPTION, VocaDecidim::SETTINGS_SMTP_AUTHENTICATION_OPTION, VocaDecidim::SETTINGS_SMTP_OPENSSL_OPTION, VocaDecidim::SeedAdminRequest, VocaDecidim::SeedAdminResponse, VocaDecidim::SetSettingsRequest

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message) ⇒ SeedAdmin

Returns a new instance of SeedAdmin.



8
9
10
11
12
# File 'app/rpc/decidim/voca/rpc/seed_admin.rb', line 8

def initialize(message)
  @message = message
  @organization = ::Decidim::Organization.first!
  @password = ::Devise.friendly_token.first(23)
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



6
7
8
# File 'app/rpc/decidim/voca/rpc/seed_admin.rb', line 6

def message
  @message
end

#organizationObject (readonly)

Returns the value of attribute organization.



6
7
8
# File 'app/rpc/decidim/voca/rpc/seed_admin.rb', line 6

def organization
  @organization
end

#passwordObject (readonly)

Returns the value of attribute password.



6
7
8
# File 'app/rpc/decidim/voca/rpc/seed_admin.rb', line 6

def password
  @password
end

Instance Method Details

#seedObject

migrate the database and insert default values.



16
17
18
19
# File 'app/rpc/decidim/voca/rpc/seed_admin.rb', line 16

def seed
  seed_system_admin!
  seed_admin!
end