Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

configure do
Dotenv.load
LIVE_URL = ENV['DATA_JSON_URL']
Dir[File.join(Dir.pwd, 'locales', '*.yml')].each {|file| I18n.load_path << file }
# Make sure only available locales are used. This will be the default in the
# future but we need this to silence a deprecation warning
Expand Down Expand Up @@ -47,4 +48,3 @@ def t(*args)
DataMapper.finalize
end

LIVE_URL = ENV['DATA_JSON_URL']
3 changes: 2 additions & 1 deletion lib/models/show.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# aliases: (array[string]) An array of aliases that can additionally match
# the show
class Show
attr_reader :title, :url, :rss, :aliases
attr_reader :title, :url, :rss, :aliases, :limit

# param json_hash: (hash) A hash of show data with the following keys:
# title: (string) The show's title
Expand All @@ -22,6 +22,7 @@ def initialize(json_hash)
@title = json_hash["title"]
@url = json_hash["url"]
@rss = json_hash["rss"]
@limit = json_hash.key?("limit") ? json_hash["limit"] : 40
@aliases = (json_hash["aliases"] || []).map do |show_alias|
show_alias.downcase
end
Expand Down
2 changes: 1 addition & 1 deletion lib/models/suggestion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Suggestion
include DataMapper::Resource

property :id, Serial
property :title, String, :length => 40,
property :title, String, :length => Shows.fetch_live_show.nil? ? 40 : Shows.fetch_live_show.limit,
:message => I18n.t('messages.models.suggestion')
property :user, String
property :show, String
Expand Down