paid_up 0.6.5 → 0.7.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1052e49f3dbc4c3610455e9ca70d8e95a135127f
4
- data.tar.gz: ea8140ab388b3dbeff901f6bff42138f1d2b7c1c
3
+ metadata.gz: 8689399aa48f6a2bf96a908d2b70d9c7b3f96d5d
4
+ data.tar.gz: f07c881f81209410ad94a5caebe4cecdf76ff601
5
5
  SHA512:
6
- metadata.gz: c5c98c4bb074579736e4dd3fafe623d7d2572f011b945a103c9f05a2501c379bf845910aa1da9d31a3c12aee29026af4faa257a43928ab5ebad180cce428db00
7
- data.tar.gz: 32df91b89d7052946a29be395ca38e414ac029a2a244b47f83cdf02cc79e272400eee30fe41a7655f8259fd0c28bf25c638995ccd70aa6f00300b3b936723bb9
6
+ metadata.gz: 18f089742dce778bad7fc3a799ba2fa645ec213b7b6aeb40817c00caf58009f4ac614fb63de123d0840e55ae41a2cfdc85b080d5cf712997eaf2e4b8d3cb27b7
7
+ data.tar.gz: c4f53fb93a8fb63094ad45dba4aa5976bb0d42a7e80390b71f5a5a477fa11337df093a3a25064aebbaa8260a7e3c42c9100212200ff377fb27fecf81f34f3ca7
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.5
1
+ 0.7.0
@@ -7,7 +7,8 @@ module PaidUp
7
7
  for feature in features
8
8
  case feature.setting_type
9
9
  when 'table_rows'
10
- can [:index, :read], feature.feature_model
10
+ can :index, feature.feature_model
11
+ can :read, feature.feature_model, enabled: true
11
12
  if user.table_rows_allowed(feature.slug) > 0 || user.table_rows_unlimited?(feature.slug)
12
13
  can :manage, feature.feature_model, :user => user
13
14
  can :own, feature.feature_model
@@ -21,7 +22,8 @@ module PaidUp
21
22
  cannot :create, feature.feature_model
22
23
  end
23
24
  when 'rolify_rows'
24
- can [:index, :read], feature.feature_model
25
+ can :index, feature.feature_model
26
+ can :read, feature.feature_model, enabled: true
25
27
  if user.rolify_rows_allowed(feature.slug) > 0 || user.rolify_rows_unlimited?(feature.slug)
26
28
  can :manage, feature.feature_model, id: Group.with_role(:owner, user).pluck(:id)
27
29
  can :own, feature.feature_model
@@ -3,6 +3,7 @@ class PaidUp::Plan < ActiveRecord::Base
3
3
  accepts_nested_attributes_for :plan_feature_settings
4
4
 
5
5
  after_initialize :load_stripe_data
6
+ after_save :expire_stripe_data
6
7
 
7
8
  attr_accessor :stripe_data
8
9
 
@@ -87,8 +88,14 @@ class PaidUp::Plan < ActiveRecord::Base
87
88
 
88
89
  def load_stripe_data
89
90
  if stripe_id.present?
90
- self.stripe_data = Stripe::Plan.retrieve stripe_id
91
+ self.stripe_data = Rails.cache.fetch("#{stripe_id}/stripe_data", expires_in: 12.hours) do
92
+ Stripe::Plan.retrieve stripe_id
93
+ end
91
94
  end
92
95
  end
93
96
 
97
+ def expire_stripe_data
98
+ Rails.cache.delete("#{stripe_id}/stripe_data")
99
+ end
100
+
94
101
  end
@@ -55,6 +55,7 @@ en:
55
55
  my_subscription: 'My Subscription'
56
56
  my_subscription_information: 'My Subscription Information'
57
57
  no_implicit_conversion_of_type_features: 'No implicit conversion of %{type} Features'
58
+ no_features_associated_with_table: 'No features associated with %{table} table.'
58
59
  or_sign_in: "Or, Sign In"
59
60
  or_sign_up: "Or, Sign Up"
60
61
  paid_thru: "Paid Thru"
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "result": {
3
- "covered_percent": 96.11
3
+ "covered_percent": 82.0
4
4
  }
5
5
  }