paid_up 0.10.4 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d2adf066309b30ac306cdf822693eaf2dc6e3584
4
- data.tar.gz: cc70e9755ea608963b06ebde8b6b9fa6faa1b494
3
+ metadata.gz: ecf88d9efba484eeafc8c1bd652e93acc7f81eb4
4
+ data.tar.gz: 756c9d2d884bb40d6d1800303a3cc4203d6953ea
5
5
  SHA512:
6
- metadata.gz: 5186bfa8079e7fa90c7bb51070925ec6cb88613ba2f15ecedfd93df29b0fb8d6d64ef53fe9b798a270e076eef070e6a7f96b3b906ad95b4a610245a3f9294516
7
- data.tar.gz: 6516dcd2d65b3183d4b8b1b9d3ae5bd93a0595a996134605bce776a44aa148b26ad288324abc4bcd8a085262e584bdedd389298106bdbc1f8e5045fb5ad90496
6
+ metadata.gz: 46314744d7658c2d2d0a8a377bccfad7f8330085d86dcca112ede7b6fc82f89d7c8e22a310dcf1e77a6bb141e9b7499984a0b6cd09abbc9f19cd6b5351eb7533
7
+ data.tar.gz: 38dbe93a7dc0446d312452bace08dff474e5908530b3eda1edaf85221c04a48b5705ebb9ba3fd27f15ccaa375a46e23bc24bac41f2fc228e8ec5c81ce2247427
data/README.md CHANGED
@@ -12,7 +12,7 @@ Paid Up is a start-to-finish Stripe subscription engine. You set up the plans an
12
12
  * Subscription by Stripe
13
13
  * Roles by Rolify
14
14
  * Uses Google Tag Manager for Google Analytics `dataLayer` object to provide e-commerce analytics.
15
- * Assumes you will be using some variety of Bootstrap, and designed to be quite responsive out of the box, but included views can be overridden with custom views.
15
+ * Assumes you will be using some variety of Bootstrap, and designed to be quite responsive out of the box. Included views can be overridden with custom views.
16
16
 
17
17
  ## Installation
18
18
 
@@ -52,7 +52,7 @@ Pay close attention to the settings in `Account Settings` under `Subscriptions`
52
52
 
53
53
  Set up each `PaidUp::Feature` using the config file. (A config file is used rather than using records in an `ActiveRecord::Base` model because relationships cannot be created at runtime.) Associate the features with the corresponding plans using the `PaidUp::PlanFeatureSetting` model. For an example, check out the seeds file at [`spec/dummy/db/seeds.db`](spec/dummy/db/seeds.db)
54
54
 
55
- Possible `:setting_type` values are: `boolean`, `table_rows`, `rolify_rows`. The latter two require that a table corresponding to the feature's `:name` value.
55
+ Possible `:setting_type` values are: `boolean`, `table_rows`, `rolify_rows`. The latter two require a table corresponding to the feature's `:name` value.
56
56
 
57
57
  #### Setting Type: Table Rows
58
58
 
@@ -62,6 +62,16 @@ In the `table_rows` case, the table and its model must exist. the table should h
62
62
 
63
63
  In the `rolify_rows` case, the table and its model must also exist. Once that is done and the corresponding `PaidUp::Feature` is created, add `paid_for` to the model. This means the resource model will run the `resourcify` method, and the User method will have had the `rolify` method added to it during install, so no further setup is required.
64
64
 
65
+ #### Scope
66
+
67
+ If you only want to count certain records against a user's tally, for example only records with `active` set to `true`, you can add the scope option with a symbol corresponding to the desired method or scope, like so:
68
+
69
+ class Post < ActiveRecord::Base
70
+ paid_for scope: :active
71
+ scope :active, -> { where(active: true) }
72
+ end
73
+
74
+
65
75
  ## Enabling Javascript
66
76
 
67
77
  In order for PaidUp's AJAX functionality to work (which is required because Stripe uses AJAX), you will need to add this to your layout file, preferably near the end of the <body> element (for speed reasons):
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.10.4
1
+ 0.11.0
@@ -42,7 +42,6 @@ module PaidUp
42
42
  def plan_button(plan, text = nil, html_options = {})
43
43
  data = {}
44
44
  css_class = ''
45
- disabled_state = false
46
45
  link = paid_up.new_plan_subscription_path(plan)
47
46
  if user_signed_in?
48
47
  text ||= :subscribe.l
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "result": {
3
- "covered_percent": 95.25
3
+ "covered_percent": 95.5
4
4
  }
5
5
  }