bullet_train 1.34.1 → 1.36.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
  SHA256:
3
- metadata.gz: 97fc736f05f5c708b32b7ba5b9ed4c073ac09e9ff70f9d382f5e4df631f74b00
4
- data.tar.gz: f0eb4ec621711396d76c71a03ef8735a1364540928621af34579b343130d6d78
3
+ metadata.gz: 5c1d33c15093050889618d0a58e53899f22dbbee55e6792adad049b36107eec6
4
+ data.tar.gz: a7a547ddbb60545ee9b2f37e984aa1b293a84ddd231a3233542ea85e5a2c5a61
5
5
  SHA512:
6
- metadata.gz: ddf91de6aa88f76ea3487d030a6da1e1374babfe32d7c1b9cea2616508b0e555c53e74120278aca1d0095bd0ede0189590958a3aea79fdd0d8d457edbd6e461c
7
- data.tar.gz: 124d6d6621509c5bb1d3f51cf2c48b7ba51f2c4cc7a075671f2ca97bf9cc55d66c1fa1f011702c42dc124891a02d3d6735f2bb1e27e40055019f216bfa360f37
6
+ metadata.gz: dafe1f7e4ec075acbd7fd8417a2080b7dc51c496eaf2b8d3b63e14262d9a43b2bce61e8ed8b42678688ba48c4346026c2ae3ce87e4b778532e7bec7931dab8e7
7
+ data.tar.gz: f25805b74ba7e7f77ccadfe2404350a312f6de5d4f223b4940f8a881c5017cccc4aa2d348fa9fca3acd3a247d2fd9b994b85dfa63b1d0c46727ee683ea85e9e8
@@ -14,6 +14,8 @@ module Invitations::Base
14
14
  after_create :set_added_by_membership
15
15
  after_create :send_invitation_email
16
16
 
17
+ after_validation :hoist_membership_email_error
18
+
17
19
  attribute :uuid, default: -> { SecureRandom.hex }
18
20
 
19
21
  def roles
@@ -44,4 +46,13 @@ module Invitations::Base
44
46
  def is_for?(user)
45
47
  user.email.downcase.strip == email.downcase.strip
46
48
  end
49
+
50
+ def hoist_membership_email_error
51
+ # This is special handling for the email field because we have a uniqueness validation in the
52
+ # `Membership` model for the `user_email` field. Since we copy the value from `invitation.email`
53
+ # into `invitation.membership.user_email` the error isn't passed through to the form in the normal way.
54
+ errors[:"membership.user_email"]&.each do |error|
55
+ errors.add(:email, error)
56
+ end
57
+ end
47
58
  end
@@ -14,7 +14,6 @@ module Teams::Base
14
14
  has_many :users, through: :memberships
15
15
  has_many :invitations
16
16
 
17
- # oauth for grape api
18
17
  has_many :platform_applications, class_name: "Platform::Application", dependent: :destroy, foreign_key: :team_id
19
18
 
20
19
  # integrations
@@ -44,6 +44,7 @@ module Users::Base
44
44
  # callbacks
45
45
  after_validation :remove_profile_photo, if: :profile_photo_removal?
46
46
  after_update :set_teams_time_zone
47
+ after_update :set_memberships_email
47
48
  end
48
49
 
49
50
  def email_is_oauth_placeholder?
@@ -159,6 +160,12 @@ module Users::Base
159
160
  end
160
161
  end
161
162
 
163
+ def set_memberships_email
164
+ if email_previously_changed?
165
+ memberships.where.not(user_email: email).update(user_email: email)
166
+ end
167
+ end
168
+
162
169
  def profile_photo_removal?
163
170
  profile_photo_removal.present?
164
171
  end
@@ -42,18 +42,11 @@ end
42
42
 
43
43
  ## Installation
44
44
 
45
- ### 1. Purchase Bullet Train Pro
45
+ We recently fully open-sourced our PRO-level features, but haven't yet merged these projects into our core repo. Until we do, you can install the action-model gem via git.
46
46
 
47
- First, [purchase Bullet Train Pro](https://buy.stripe.com/aEU7vc4dBfHtfO89AV). Once you've completed this process, you'll be issued a private token for the Bullet Train Pro package server. The process is currently completed manually, so you may have to wait a little to receive your keys.
48
-
49
- ### 2. Install the Package
50
-
51
- Then you can specify the Ruby gem in your `Gemfile`:
52
-
53
- ```ruby
54
- source "https://YOUR_TOKEN_HERE@gem.fury.io/bullettrain" do
55
- gem "bullet_train-action_models"
56
- end
47
+ ```
48
+ # Below the comment labelled YOUR GEMS in your Gemfile
49
+ gem "bullet_train-action_models", git: "https://github.com/bullet-train-pro/bullet_train-action_models.git"
57
50
  ```
58
51
 
59
52
  Don't forget to run `bundle install` and `rails restart`.
@@ -4,34 +4,11 @@ When you're ready to start billing customers for the product you've created with
4
4
 
5
5
  We also provide a Stripe-specific adapter package with support for auto-configuring those products and prices in your Stripe account. It also takes advantage of completely modern Stripe workflows, like allowing customers to purchase your product with Stripe Checkout and later manage their subscription using Stripe Billing's customer portal. It also automatically handles incoming Stripe webhooks as well, to keep subscription state in your application up-to-date with activity that has happened on Stripe's platform.
6
6
 
7
- ## Option A: Using the Paid Bullet Train Pro gem via Gemfury
7
+ ## Install the Bullet Train Billing gems via git
8
8
 
9
- ### A.1. Purchase Bullet Train Billing for Stripe
9
+ We recently fully open-sourced our PRO-level features, but haven't yet merged these projects into our core repo. Until we do, you can install the billing gems via git.
10
10
 
11
- First, [purchase Bullet Train Billing for Stripe](https://buy.stripe.com/28o8zg4dBbrd59u7sM). Once you've completed this process, you'll be issued a private token for the Bullet Train Pro package server. (This process is currently completed manually, so please be patient.)
12
-
13
- ### A.2. Add the Private Ruby Gems
14
-
15
- You'll need to specify both Ruby gems in your `Gemfile`, since we have to specify a private source for both:
16
-
17
- ```ruby
18
- source "https://YOUR_TOKEN_HERE@gem.fury.io/bullettrain" do
19
- gem "bullet_train-billing"
20
- gem "bullet_train-billing-stripe"
21
- end
22
- ```
23
-
24
- ### A.3. Bundle Install
25
-
26
- ```
27
- bundle install
28
- ```
29
-
30
- **Proceed to the [Installation Instructions](#installation-instructions) section below**
31
-
32
- ## Option B: Using the Open Source version of Bullet Train Billing via git
33
-
34
- ### B.1. Add the Git Repositories
11
+ ### 1. Add the gems via git
35
12
 
36
13
  ```
37
14
  # Below the comment labelled YOUR GEMS in your Gemfile
@@ -39,7 +16,7 @@ gem "bullet_train-billing", git: "https://github.com/bullet-train-pro/bullet_tra
39
16
  gem "bullet_train-billing-stripe", git: "https://github.com/bullet-train-pro/bullet_train-billing-stripe.git"
40
17
  ```
41
18
 
42
- ### B.2. Bundle Install
19
+ ### 2. Bundle Install
43
20
 
44
21
  ```
45
22
  bundle install
@@ -54,8 +31,6 @@ Fetching gem metadata from https://rubygems.org/........
54
31
  <all of your normal gems>
55
32
  ```
56
33
 
57
- **Proceed to the [Installation Instructions](#installation-instructions) section below**
58
-
59
34
  ## Installation Instructions
60
35
 
61
36
  ### Prerequisites
@@ -4,31 +4,24 @@ Bullet Train provides a holistic method for defining model-based usage limits in
4
4
 
5
5
  ## Installation
6
6
 
7
- ### 1. Purchase Bullet Train Pro
7
+ ### 1. Add the gems via git
8
8
 
9
- First, [purchase Bullet Train Pro](https://buy.stripe.com/aEU7vc4dBfHtfO89AV). Once you've completed this process, you'll be issued a private token for the Bullet Train Pro package server. The process is currently completed manually, so you may have to wait a little to receive your keys.
9
+ We recently fully open-sourced our PRO-level features, but haven't yet merged these projects into our core repo. Until we do, you can install the action-model gem via git.
10
10
 
11
- ### 2. Install the Package
12
-
13
- ### 2.1. Add the Private Ruby Gems
14
-
15
- You'll need to specify both Ruby gems in your `Gemfile`, since we have to specify a private source for both:
16
-
17
- ```ruby
18
- source "https://YOUR_TOKEN_HERE@gem.fury.io/bullettrain" do
19
- gem "bullet_train-billing"
20
- gem "bullet_train-billing-stripe" # Or whichever billing provider you're using.
21
- gem "bullet_train-billing-usage"
22
- end
11
+ ```
12
+ # Below the comment labelled YOUR GEMS in your Gemfile
13
+ gem "bullet_train-billing", git: "https://github.com/bullet-train-pro/bullet_train-billing.git"
14
+ gem "bullet_train-billing-stripe", git: "https://github.com/bullet-train-pro/bullet_train-billing-stripe.git"
15
+ gem "bullet_train-billing-usage", git: "https://github.com/bullet-train-pro/bullet_train-billing-usage.git"
23
16
  ```
24
17
 
25
- ### 2.2. Bundle Install
18
+ ### 2. Bundle Install
26
19
 
27
20
  ```
28
21
  bundle install
29
22
  ```
30
23
 
31
- ### 2.3. Copy Database Migrations
24
+ ### 3. Copy Database Migrations
32
25
 
33
26
  Use the following two commands on your shell to copy the required migrations into your local project:
34
27
 
@@ -1,3 +1,3 @@
1
1
  module BulletTrain
2
- VERSION = "1.34.1"
2
+ VERSION = "1.36.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.34.1
4
+ version: 1.36.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver