Skip to content
Open
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
4 changes: 2 additions & 2 deletions saas/app/models/account/limited.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ def billed_bytes_used
end

def nearing_plan_cards_limit?
plan.limit_cards? && remaining_cards_count < NEAR_CARD_LIMIT_THRESHOLD
plan.limit_cards? && remaining_cards_count <= NEAR_CARD_LIMIT_THRESHOLD
end

def exceeding_card_limit?
plan.limit_cards? && billed_cards_count > plan.card_limit
plan.limit_cards? && billed_cards_count >= plan.card_limit
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should be just > so that the account can't simultaneously be near and over the limit?

This conceptually also makes sense - on the free plan you can publish 1000 cards, but you can't publish the 1001st card since it's over the limit.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree with @monorkin, I think this should be just >.

I am curious, was this causing some user-facing bug in the app?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is stated well in the Fizzy card. Right now, after you've created 1000 cards and go to create another one, the message says "You've used 1000 of 1000 cards", but you can still create another one (card 1001). Seems like the Upgrade prompt should kick in when you have 1000 cards, not 1001.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think @andyra's logic is correct here, we want to check for >=. It might be the name that's confusing us: the state we're trying to detect is "reached plan limit", not exceeded it, I think?

end

def nearing_plan_storage_limit?
Expand Down
Loading