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:
Tom Hughes 2010-08-04 22:06:05 +01:00
parent 8b9cacd3c2
commit f07819d81a
33 changed files with 100 additions and 99 deletions

View file

@ -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