bullet_train 1.9.0 → 1.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/concerns/memberships/base.rb +10 -0
- data/app/models/concerns/teams/base.rb +12 -0
- data/app/models/concerns/users/base.rb +1 -1
- data/config/locales/en/base.yml +1 -0
- data/config/models/roles.yml +37 -0
- data/lib/bullet_train/version.rb +1 -1
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 476b5c3d4c9b745aa40ae138671c83c98654acd7ebc3070928778413313f9f4f
|
4
|
+
data.tar.gz: 472afd1105a7d81eca8465b01771591c84b10da24c8df90772785303c71a7d88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4749dedcfb1e22982f6288e65f16deb037a3647041cc62027e85af3f6ce152a86298c65f4351c0b1f8ad6730196ab8781433f75402059dabebfdae24fd6d281b
|
7
|
+
data.tar.gz: 25a8e4e1fb083356e8511728c7defe161070561a6d80649ef350806b7578b60833fd14c7867d3b97ab5ccb96bcfd7dfa7c922a79ddf26a4a6edfb0aab4046a6c
|
@@ -32,6 +32,8 @@ module Memberships::Base
|
|
32
32
|
|
33
33
|
after_commit :publish_changed_quantity
|
34
34
|
|
35
|
+
after_create :set_team_time_zone, if: :is_first_membership?
|
36
|
+
|
35
37
|
after_validation :remove_user_profile_photo, if: :user_profile_photo_removal?
|
36
38
|
|
37
39
|
scope :excluding_platform_agents, -> { where(platform_agent_of: nil) }
|
@@ -157,5 +159,13 @@ module Memberships::Base
|
|
157
159
|
ActiveSupport::Notifications.instrument("memberships.quantity-changed", {team:})
|
158
160
|
end
|
159
161
|
|
162
|
+
def set_team_time_zone
|
163
|
+
team.set_time_zone_from_user(user)
|
164
|
+
end
|
165
|
+
|
166
|
+
def is_first_membership?
|
167
|
+
team.memberships.count == 1 && team.memberships.first.id == id
|
168
|
+
end
|
169
|
+
|
160
170
|
ActiveSupport.run_load_hooks :bullet_train_memberships_base, self
|
161
171
|
end
|
@@ -25,6 +25,18 @@ module Teams::Base
|
|
25
25
|
validates :time_zone, inclusion: {in: ActiveSupport::TimeZone.all.map(&:name)}, allow_nil: true
|
26
26
|
end
|
27
27
|
|
28
|
+
def initialize(attributes = nil)
|
29
|
+
super
|
30
|
+
self.time_zone = "UTC" if time_zone.blank?
|
31
|
+
end
|
32
|
+
|
33
|
+
def set_time_zone_from_user(user)
|
34
|
+
if time_zone.blank? || time_zone == "UTC"
|
35
|
+
self.time_zone = user.time_zone if user.time_zone.present?
|
36
|
+
save
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
28
40
|
def platform_agent_access_tokens
|
29
41
|
Platform::AccessToken.joins(:application).where(resource_owner_id: users.where.not(platform_agent_of_id: nil), application: {team: nil})
|
30
42
|
end
|
data/config/locales/en/base.yml
CHANGED
@@ -0,0 +1,37 @@
|
|
1
|
+
default:
|
2
|
+
models:
|
3
|
+
Team: read
|
4
|
+
Document: read
|
5
|
+
Membership:
|
6
|
+
- read
|
7
|
+
- search
|
8
|
+
|
9
|
+
crud_role:
|
10
|
+
models:
|
11
|
+
Team: crud
|
12
|
+
|
13
|
+
editor:
|
14
|
+
models:
|
15
|
+
Scaffolding::AbsolutelyAbstract::CreativeConcept:
|
16
|
+
- read
|
17
|
+
- update
|
18
|
+
|
19
|
+
manager:
|
20
|
+
includes:
|
21
|
+
- editor
|
22
|
+
|
23
|
+
supervisor:
|
24
|
+
includes:
|
25
|
+
- manager
|
26
|
+
|
27
|
+
admin:
|
28
|
+
includes:
|
29
|
+
- editor
|
30
|
+
manageable_roles:
|
31
|
+
- admin
|
32
|
+
- editor
|
33
|
+
models:
|
34
|
+
Team: manage
|
35
|
+
Membership: manage
|
36
|
+
Document: manage
|
37
|
+
Scaffolding::AbsolutelyAbstract::CreativeConcept: manage
|
data/lib/bullet_train/version.rb
CHANGED
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.
|
4
|
+
version: 1.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Culver
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-11-
|
11
|
+
date: 2024-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: standard
|
@@ -486,6 +486,20 @@ dependencies:
|
|
486
486
|
- - ">="
|
487
487
|
- !ruby/object:Gem::Version
|
488
488
|
version: '0'
|
489
|
+
- !ruby/object:Gem::Dependency
|
490
|
+
name: pg
|
491
|
+
requirement: !ruby/object:Gem::Requirement
|
492
|
+
requirements:
|
493
|
+
- - "~>"
|
494
|
+
- !ruby/object:Gem::Version
|
495
|
+
version: '1.3'
|
496
|
+
type: :development
|
497
|
+
prerelease: false
|
498
|
+
version_requirements: !ruby/object:Gem::Requirement
|
499
|
+
requirements:
|
500
|
+
- - "~>"
|
501
|
+
- !ruby/object:Gem::Version
|
502
|
+
version: '1.3'
|
489
503
|
- !ruby/object:Gem::Dependency
|
490
504
|
name: devise-pwned_password
|
491
505
|
requirement: !ruby/object:Gem::Requirement
|
@@ -680,6 +694,7 @@ files:
|
|
680
694
|
- config/locales/en/teams.en.yml
|
681
695
|
- config/locales/en/users.en.yml
|
682
696
|
- config/locales/localization.en.yml
|
697
|
+
- config/models/roles.yml
|
683
698
|
- config/routes.rb
|
684
699
|
- db/migrate/20161115160419_devise_create_users.rb
|
685
700
|
- db/migrate/20161116003852_add_api_key_to_user.rb
|