pricing_plans 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/pricing_plans/plan_owner.rb +10 -0
- data/lib/pricing_plans/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 99983bea54e570eebe0d01fecb11245816a95ed60eb7cc87a61756009764817f
|
|
4
|
+
data.tar.gz: 388d3c8b0791cf5388dda9d670a21fd53613105cefcf861c2769667f9f15fab1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f99451ddc7aaba6ea9cf5bebf81395ee88383cb5a27cd2efb491ae78a711d99115f4cb5c1fade02aaa9d8cc6b09afcefe96abc8e3f00cf772d4e797b66a13424
|
|
7
|
+
data.tar.gz: bd14a7080334f2e6aeb215739d33ac3d91f97803a706dfcd83c8053b185ba36fd7797804e4a41a10500946acb00667dfabb6536fa3e184bbac41923e3adef375
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
## [0.3.1] - 2026-02-16
|
|
2
|
+
|
|
3
|
+
- **Add `has_plan_assignment?` helper**: Check if a plan owner has a manual assignment without full plan resolution
|
|
4
|
+
- **Add `plan_assignment` helper**: Retrieve the assignment record directly for inspection
|
|
5
|
+
|
|
1
6
|
## [0.3.0] - 2026-02-15
|
|
2
7
|
|
|
3
8
|
- **Manual assignments now override subscriptions**: Admin overrides take precedence over Pay/Stripe plans (was incorrectly reversed) -- current plan resolution order: manual assignment → Pay subscription → default plan
|
|
@@ -203,6 +203,16 @@ module PricingPlans
|
|
|
203
203
|
plan&.free? || false
|
|
204
204
|
end
|
|
205
205
|
|
|
206
|
+
def has_plan_assignment?
|
|
207
|
+
return false unless respond_to?(:id) && id.present?
|
|
208
|
+
Assignment.exists?(plan_owner_type: self.class.name, plan_owner_id: id)
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
def plan_assignment
|
|
212
|
+
return nil unless respond_to?(:id) && id.present?
|
|
213
|
+
Assignment.find_by(plan_owner_type: self.class.name, plan_owner_id: id)
|
|
214
|
+
end
|
|
215
|
+
|
|
206
216
|
def assign_pricing_plan!(plan_key, source: "manual")
|
|
207
217
|
Assignment.assign_plan_to(self, plan_key, source: source)
|
|
208
218
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pricing_plans
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- rameerez
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-02-
|
|
10
|
+
date: 2026-02-16 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: activerecord
|