Improve code
This commit is contained in:
parent
9e91d26b14
commit
212586b660
|
@ -31,7 +31,7 @@ module Partynest
|
||||||
].freeze
|
].freeze
|
||||||
|
|
||||||
def settings(name)
|
def settings(name)
|
||||||
config_for "settings/#{name}"
|
config_for("settings/#{name}").deep_symbolize_keys
|
||||||
end
|
end
|
||||||
|
|
||||||
# Initialize configuration defaults for originally generated Rails version.
|
# Initialize configuration defaults for originally generated Rails version.
|
||||||
|
|
|
@ -65,7 +65,7 @@ Rails.application.configure do
|
||||||
config.log_tags = [:request_id]
|
config.log_tags = [:request_id]
|
||||||
|
|
||||||
# Use a different cache store in production.
|
# Use a different cache store in production.
|
||||||
cache_conf = Rails.application.settings(:cache_store).deep_symbolize_keys
|
cache_conf = Rails.application.settings :cache_store
|
||||||
config.cache_store = :redis_cache_store, {
|
config.cache_store = :redis_cache_store, {
|
||||||
host: cache_conf[:host],
|
host: cache_conf[:host],
|
||||||
port: cache_conf[:port],
|
port: cache_conf[:port],
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
# Be sure to restart your server when you modify this file.
|
# Be sure to restart your server when you modify this file.
|
||||||
|
|
||||||
conf = Rails.application.settings(:smtp).deep_symbolize_keys
|
conf = Rails.application.settings :smtp
|
||||||
|
|
||||||
ActionMailer::Base.smtp_settings = {
|
ActionMailer::Base.smtp_settings = {
|
||||||
address: conf[:address],
|
address: conf[:address],
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
# Be sure to restart your server when you modify this file.
|
# Be sure to restart your server when you modify this file.
|
||||||
|
|
||||||
conf = Rails.application.settings(:devise).deep_symbolize_keys
|
conf = Rails.application.settings :devise
|
||||||
|
|
||||||
# Use this hook to configure devise mailer, warden hooks and so forth.
|
# Use this hook to configure devise mailer, warden hooks and so forth.
|
||||||
# Many of these configuration options can be set straight in your model.
|
# Many of these configuration options can be set straight in your model.
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
# Be sure to restart your server when you modify this file.
|
# Be sure to restart your server when you modify this file.
|
||||||
|
|
||||||
client_conf = Rails.application.settings(:sidekiq_client).deep_symbolize_keys
|
client_conf = Rails.application.settings :sidekiq_client
|
||||||
server_conf = Rails.application.settings(:sidekiq_server).deep_symbolize_keys
|
server_conf = Rails.application.settings :sidekiq_server
|
||||||
|
|
||||||
Sidekiq.configure_client do |config|
|
Sidekiq.configure_client do |config|
|
||||||
config.redis = {
|
config.redis = {
|
||||||
|
|
|
@ -10,7 +10,7 @@ country_state_names.each do |name|
|
||||||
CountryState.create! name: name
|
CountryState.create! name: name
|
||||||
end
|
end
|
||||||
|
|
||||||
Rails.application.settings(:superuser).deep_symbolize_keys.tap do |config|
|
Rails.application.settings(:superuser).tap do |config|
|
||||||
User.where(email: config[:email]).first_or_create! do |new_user|
|
User.where(email: config[:email]).first_or_create! do |new_user|
|
||||||
new_user.account = Account.create!
|
new_user.account = Account.create!
|
||||||
new_user.password = config[:password]
|
new_user.password = config[:password]
|
||||||
|
|
Reference in New Issue