bullet_train 1.3.11 → 1.3.12

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: 3e978873b55ca6a15b2b500915937a0eaa092d9bc5a8a8b2f8dc1f10d6ac27f7
4
- data.tar.gz: 8756fd456af1bc3f70429c78234175e00d28fbefe04fa9253182831fefb084a3
3
+ metadata.gz: ff63727028d8970aacd62bb659702ef467d8ee0627935977b444cb49e77f1344
4
+ data.tar.gz: 5f136b1f3c5c320cfecbcb52103f327fd48e043647e54473db02b2c6c5a2df3e
5
5
  SHA512:
6
- metadata.gz: 9988ba16cd8b3c98161e4ba478e97f93b87152211592c93b62f4ba898fd6131e3a6abfd3190e0975a9e7ab1bef9fb53b3c0e783d481823dd0e37423fa44f4845
7
- data.tar.gz: 42f98d7b289251a81263282265b307e4f3901e8e5379c7b95f4ba4451318e1aa4b9f9b99a1b96a75c0e9aa4ee3cd2afd5c4b82896705e3542bbe63d13b9a0f01
6
+ metadata.gz: 2d5d9b223e72b434743d32e1e82902d4b9ca5eec1379420d2f5bf8afaeae25987cc10e111aaf7623cd5ad37025fd055e86457dc816b17ba29c519bb4da88f066
7
+ data.tar.gz: '0539a2acd42bd86c633c1733e89e4bd0837775b5786d15732f0f36bbe07f38c8f3fc395973877d56d7b7948033f945ac89b163e73904fe33cc5a5f2f14821142'
@@ -9,7 +9,7 @@ module Invitations::Base
9
9
 
10
10
  accepts_nested_attributes_for :membership
11
11
 
12
- validates :email, presence: true
12
+ validates :email, presence: true, uniqueness: {scope: :team}
13
13
 
14
14
  after_create :set_added_by_membership
15
15
  after_create :send_invitation_email
@@ -21,6 +21,8 @@ module Memberships::Base
21
21
  # Image uploading
22
22
  has_one_attached :user_profile_photo
23
23
 
24
+ validates :user_email, uniqueness: {scope: :team}
25
+
24
26
  after_destroy do
25
27
  # if we're destroying a user's membership to the team they have set as
26
28
  # current, then we need to remove that so they don't get an error.
@@ -71,7 +71,7 @@ module Users::Base
71
71
  def create_default_team
72
72
  # This creates a `Membership`, because `User` `has_many :teams, through: :memberships`
73
73
  default_team = teams.create(name: I18n.t("teams.new.default_team_name"), time_zone: time_zone)
74
- memberships.find_by(team: default_team).update role_ids: [Role.admin.id]
74
+ memberships.find_by(team: default_team).update(user_email: email, role_ids: [Role.admin.id])
75
75
  update(current_team: default_team)
76
76
  end
77
77
 
@@ -59,6 +59,7 @@ en:
59
59
  resent: 'Invitation was successfully resent.'
60
60
  resent_error: Sorry, we couldn't find an invitation to resend.
61
61
  doesnt_exist: Sorry, but we couldn't find your invitation. Please contact an administrator on the team to have them send you another one.
62
+ duplicate: 'Sorry, a member with the email %{user_email} has already been invited.'
62
63
  values:
63
64
  name: 'Invitation to Join %{team_name}'
64
65
  account:
@@ -1,3 +1,3 @@
1
1
  module BulletTrain
2
- VERSION = "1.3.11"
2
+ VERSION = "1.3.12"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.11
4
+ version: 1.3.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-22 00:00:00.000000000 Z
11
+ date: 2023-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard