This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "active_support/time" | |
class DueDateCalculator | |
def initialize(season) | |
@season = season | |
end | |
def calculate | |
@season.upcoming_round.start_date - 1.day | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SeasonTicket < ActiveRecord::Base | |
# ... | |
def order! | |
self.price = calculate_price | |
self.status = :ordered | |
save! | |
self | |
end | |
# ... | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe "Amazon bounce handling process" do | |
# We have subscriptions on email "[email protected]" in different clients | |
# When last email to him was returned with "permanent failure" | |
# Then all subscription on email "[email protected]" are marked as bounced | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SeasonManager | |
NoSeason = Class.new(StandardError) | |
# actual league that we players are playing, if we are in the right date window | |
def self.active | |
Season.active | |
end | |
# in season break, it return next season | |
def self.upcoming |
OlderNewer