Skip to content

Commit

Permalink
[api] read download_url and ymp_url from configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
coolo committed Jul 24, 2013
1 parent 573b7a3 commit ed1ba8e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/api/app/helpers/public_helper.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module PublicHelper
def download_url(path)
path ? File.join(CONFIG['download_url'], path) : ""
path ? File.join(Configuration.download_url, path) : ""
end

def ymp_url(path)
path ? File.join(CONFIG['ymp_url'], path) : ""
path ? File.join(Configuration.ymp_url, path) : ""
end
end
9 changes: 9 additions & 0 deletions src/api/app/models/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ def anonymous?
def registration
Configuration.limit(1).pluck(:registration).first
end

def download_url
Configuration.limit(1).pluck(:download_url).first
end

def ymp_url
Configuration.limit(1).pluck(:ymp_url).first
end

end

def update_from_options_yml()
Expand Down

0 comments on commit ed1ba8e

Please sign in to comment.