Releases: rameerez/pricing_plans
v0.3.2
What's Changed
- Fix stale grace warnings after plan upgrades: Grace/blocked flags now auto-clear when usage drops below limit (self-healing state)
- Fix grace triggering at exact limit:
grace_then_blocknow uses>(over limit) not>=(at limit) - Add lazy grace creation: Grace starts on-demand when checking status, even if callbacks were bypassed
- Add
ExceededStateUtilsmodule: DRY extraction for shared exceeded/blocked logic
See #21 for full details.
What's Changed
Full Changelog: v0.3.1...v0.3.2
v0.3.1
What's New
- Add
has_plan_assignment?helper: Check if a plan owner has a manual assignment without full plan resolution - Add
plan_assignmenthelper: Retrieve the assignment record directly for inspection
These helpers are useful for UI conditionals (like upsell banners) that need to check for admin overrides without going through the full plan resolution logic.
v0.3.0
Manual assignments now correctly override subscriptions
Admin overrides (via assign_pricing_plan!) now take precedence over Pay/Stripe subscription-based plans. Previously, subscriptions incorrectly won, making manual overrides useless.
Performance: Fix N+1 queries when checking status
The status() method now uses request-scoped caching, reducing database queries by ~85% when checking multiple limits.
Automatic callbacks
Limit events (on_limit_warning, on_limit_exceeded, on_grace_start, on_block) now fire automatically when limits change—no manual checks needed.
Admin dashboard scopes
New scopes for building admin dashboards: within_all_limits, exceeding_any_limit, in_grace_period, blocked.
What's Changed
What's Changed
- Add class-level scopes for admin dashboards by @rameerez in #17
- Add automatic callback firing for limit events by @rameerez in #18
- Bug: Overly Unique EnforecementState by @stuyam in #16
- Fix N+1 query problem in status() with StatusContext pattern by @rameerez in #19
- Fix manual assignment precedence over subscriptions by @rameerez in #20
New Contributors
Full Changelog: v0.2.1...v0.3.0
v0.2.1
v0.2.0
Rails 8 support + don't throw on controller guards
🎉 Initial release!
v0.1.0 Update CHANGELOG