Skip to content

Commit bb7c25e

Browse files
committed
options keys are strings
1 parent 4025bdc commit bb7c25e

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

lib/baseballbot/models/subreddit.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def now = Baseballbot::Utility.parse_time(Time.now.utc, in_time_zone: timezone)
3939

4040
def today = now.to_date
4141

42-
def timezone = options[:timezone] || 'America/Los_Angeles'
42+
def timezone = options['timezone'] || 'America/Los_Angeles'
4343
end
4444
end
4545
end

lib/baseballbot/posts/base.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def update_sticky(sticky)
2424
if submission.stickied?
2525
submission.remove_sticky if sticky == false
2626
elsif sticky
27-
submission.make_sticky(slot: subreddit.options[:sticky_slot])
27+
submission.make_sticky(slot: subreddit.options['sticky_slot'])
2828
end
2929
end
3030
end

lib/baseballbot/subreddit.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def initialize(row, bot:, bot_account:)
1616
@submissions = {}
1717
@options = row[:options].to_h
1818

19-
@timezone = Baseballbot::Utility.parse_time_zone options[:timezone]
19+
@timezone = Baseballbot::Utility.parse_time_zone options['timezone']
2020
end
2121

2222
def instance_variables_to_inspect = %i[@id @name @team_id]

lib/baseballbot/templates/game_threads/links.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def thumbnail
2020
end
2121

2222
# Default to the /r/baseball discord server
23-
def discord_link = @subreddit.options[:discord_invite] || 'https://discord.gg/rbaseball'
23+
def discord_link = @subreddit.options['discord_invite'] || 'https://discord.gg/rbaseball'
2424
end
2525
end
2626
end

spec/baseballbot/templates/game_threads/links_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
end
3939

4040
it 'uses a custom discord link if set' do
41-
template.instance_variable_get(:@subreddit).options[:discord_invite] = 'https://discordapp.com/invite/abc123'
41+
template.instance_variable_get(:@subreddit).options['discord_invite'] = 'https://discordapp.com/invite/abc123'
4242

4343
expect(template.discord_link).to eq 'https://discordapp.com/invite/abc123'
4444
end

0 commit comments

Comments
 (0)