Skip to content

Releases: rameerez/pricing_plans

v0.3.2

25 Feb 01:25

Choose a tag to compare

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_block now uses > (over limit) not >= (at limit)
  • Add lazy grace creation: Grace starts on-demand when checking status, even if callbacks were bypassed
  • Add ExceededStateUtils module: DRY extraction for shared exceeded/blocked logic

See #21 for full details.

What's Changed

  • Fix stale grace state after plan upgrades and correct threshold semantics by @rameerez in #21

Full Changelog: v0.3.1...v0.3.2

v0.3.1

16 Feb 00:52

Choose a tag to compare

What's New

  • Add has_plan_assignment? helper: Check if a plan owner has a manual assignment without full plan resolution
  • Add plan_assignment helper: 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

15 Feb 19:14

Choose a tag to compare

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

15 Jan 18:51
2dbc34b

Choose a tag to compare

What's Changed

  • Add plan metadata alias and expose it in pricing views by @rameerez in #15

Full Changelog: v0.2.0...v0.2.1

v0.2.0

26 Dec 19:31

Choose a tag to compare

  • Fix a bug in the pay gem integration that would always return the default pricing plan regardless of the actual Pay subscription (#9)
  • Add hidden plans, enabling grandfathering, no-free-users use cases, etc. (#10)
  • Prevent unlimited limits for limits that were undefined (#11)

Rails 8 support + don't throw on controller guards

26 Dec 00:05

Choose a tag to compare

  • Add support for Rails 8+ (#5, #6)
  • Fix a bug where throw :abort was causing UncaughtThrowError exceptions in controller guards, and instead return false from before_action callbacks to halt the filter chain, rather than using the uncaught throw (#7)

🎉 Initial release!

19 Aug 17:43

Choose a tag to compare

v0.1.0

Update CHANGELOG