Rework application configuration
Use a preinitializer to load the settings from application.yml so that they are available as early as possible. All settings can also be overridden using environment variables. The ad-hoc settins in environment.rb are then moved to this new system so we have one consistent location for settings.
This commit is contained in:
parent
8b9cacd3c2
commit
f07819d81a
33 changed files with 100 additions and 99 deletions
|
@ -8,7 +8,7 @@ class SpamObserver < ActiveRecord::Observer
|
|||
when record.is_a?(DiaryComment): user = record.user
|
||||
end
|
||||
|
||||
if user.status == "active" and user.spam_score > APP_CONFIG['spam_threshold']
|
||||
if user.status == "active" and user.spam_score > SPAM_THRESHOLD
|
||||
user.update_attributes(:status => "suspended")
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue