Move all settings to settings.yml
We leave the STATUS setting alone, since it's required before rails boots. The test-specific settings now live in config/settings/test.yml
This commit is contained in:
parent
7b08270526
commit
d102c9aaf4
62 changed files with 316 additions and 349 deletions
|
@ -67,7 +67,7 @@ class ClientApplication < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def oauth_server
|
||||
@oauth_server ||= OAuth::Server.new("https://" + SERVER_URL)
|
||||
@oauth_server ||= OAuth::Server.new("https://" + Settings.server_url)
|
||||
end
|
||||
|
||||
def credentials
|
||||
|
|
|
@ -77,6 +77,6 @@ class RequestToken < OauthToken
|
|||
end
|
||||
|
||||
def oauth10?
|
||||
(defined? OAUTH_10_SUPPORT) && OAUTH_10_SUPPORT && callback_url.blank?
|
||||
Settings.key?(:oauth_10_support) && Settings.oauth_10_support && callback_url.blank?
|
||||
end
|
||||
end
|
||||
|
|
|
@ -110,15 +110,15 @@ class Trace < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def large_picture_name
|
||||
"#{GPX_IMAGE_DIR}/#{id}.gif"
|
||||
"#{Settings.gpx_image_dir}/#{id}.gif"
|
||||
end
|
||||
|
||||
def icon_picture_name
|
||||
"#{GPX_IMAGE_DIR}/#{id}_icon.gif"
|
||||
"#{Settings.gpx_image_dir}/#{id}_icon.gif"
|
||||
end
|
||||
|
||||
def trace_name
|
||||
"#{GPX_TRACE_DIR}/#{id}.gpx"
|
||||
"#{Settings.gpx_trace_dir}/#{id}.gpx"
|
||||
end
|
||||
|
||||
def mime_type
|
||||
|
|
|
@ -201,7 +201,7 @@ class User < ActiveRecord::Base
|
|||
@preferred_languages = nil
|
||||
end
|
||||
|
||||
def nearby(radius = NEARBY_RADIUS, num = NEARBY_USERS)
|
||||
def nearby(radius = Settings.nearby_radius, num = Settings.nearby_users)
|
||||
if home_lon && home_lat
|
||||
gc = OSM::GreatCircle.new(home_lat, home_lon)
|
||||
sql_for_area = QuadTile.sql_for_area(gc.bounds(radius), "home_")
|
||||
|
@ -300,7 +300,7 @@ class User < ActiveRecord::Base
|
|||
##
|
||||
# perform a spam check on a user
|
||||
def spam_check
|
||||
update(:status => "suspended") if status == "active" && spam_score > SPAM_THRESHOLD
|
||||
update(:status => "suspended") if status == "active" && spam_score > Settings.spam_threshold
|
||||
end
|
||||
|
||||
##
|
||||
|
|
|
@ -32,7 +32,7 @@ class UserBlock < ActiveRecord::Base
|
|||
belongs_to :creator, :class_name => "User", :foreign_key => :creator_id
|
||||
belongs_to :revoker, :class_name => "User", :foreign_key => :revoker_id
|
||||
|
||||
PERIODS = USER_BLOCK_PERIODS
|
||||
PERIODS = Settings.user_block_periods
|
||||
|
||||
##
|
||||
# scope to match active blocks
|
||||
|
|
|
@ -206,7 +206,7 @@ class Way < ActiveRecord::Base
|
|||
|
||||
def preconditions_ok?(old_nodes = [])
|
||||
return false if nds.empty?
|
||||
raise OSM::APITooManyWayNodesError.new(id, nds.length, MAX_NUMBER_OF_WAY_NODES) if nds.length > MAX_NUMBER_OF_WAY_NODES
|
||||
raise OSM::APITooManyWayNodesError.new(id, nds.length, Settings.max_number_of_way_nodes) if nds.length > Settings.max_number_of_way_nodes
|
||||
|
||||
# check only the new nodes, for efficiency - old nodes having been checked last time and can't
|
||||
# be deleted when they're in-use.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue