tramway-user 2.1.3.2 → 2.2

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
  SHA256:
3
- metadata.gz: 7e851bd295fc9e5b424e7fed3f268bf596f501fcf384f128cd75c3970e6ed007
4
- data.tar.gz: 3f6c194a8612bd6f9dd60a9dfa829ba246efcab9726cc21c320883d8ed0ffb7a
3
+ metadata.gz: d5df2c8ff9fd3616ed52d20de965f897cca936d937439d43b8f68b404ec5a7bf
4
+ data.tar.gz: 5eddf1dbc298384c418a0941ebc9a8c1307f6d8e279e13f19b18e06270a618ec
5
5
  SHA512:
6
- metadata.gz: eee709ebed4e014d70b51aa7109300749546e0ee2e682aa4b73aafc96b30cf29b2803c75c5fa81d7560d350b28fd83bfcbf087cabfd850d66eb34064becaa670
7
- data.tar.gz: 10a39f9802133bf9786518bb4749afcdfd70bded4264cdba20f1c41b33d928cd68c66031997e0bc89d701f14276a6e1e3f8e806a94e10f19266a5e22335f142a
6
+ metadata.gz: 3befaf4f6ece37d64c38e668d3ecc6d1e7aafd4049b1abb756813b96eee3ecc9c412f048afd3f27c07177b05cdcb3d92f47cf8a0de52a9ed02d9d08a2af84222
7
+ data.tar.gz: 95ee062de720d2d521940ce1e18d696ad877dd7c7bacb328e293bb03949c10a55ba0a51ebe3b128a83c4b11dae09c60b7e007fcdae861cdd4411c8273450dfd8
data/README.md CHANGED
@@ -26,6 +26,10 @@ $ gem install tramway-user
26
26
 
27
27
  `Tramway::User::User` has scope `admins` which returns all admins from the app.
28
28
 
29
+ ## Instructions
30
+
31
+ Edit roles for `Tramway::User::User` model - [doc](https://github.com/ulmic/tramway-dev/tree/develop/tramway#if-you-want-to-edit-roles-to-the-tramwayuseruser-class)
32
+
29
33
  ## Contributing
30
34
  Contribution directions go here.
31
35
 
@@ -28,4 +28,6 @@ class Tramway::User::UserDecorator < ::Tramway::Core::ApplicationDecorator
28
28
  def name
29
29
  "#{object&.first_name} #{object&.last_name}"
30
30
  end
31
+
32
+ alias title name
31
33
  end
@@ -5,8 +5,8 @@ class Admin::Tramway::User::UserForm < ::Tramway::Core::ApplicationForm
5
5
 
6
6
  properties :email, :password, :first_name, :last_name, :role, :phone
7
7
 
8
- validates :email, email: true
9
- validates :email, uniqueness: true, if: 'active?'
8
+ # fix me
9
+ validates :email, email: true, uniqueness: true, on: :destroy unless model_class.columns_hash['project_id'].present?
10
10
 
11
11
  def initialize(object)
12
12
  super(object).tap do
@@ -12,6 +12,10 @@ class Tramway::User::User < ::Tramway::Core::ApplicationRecord
12
12
  role.admin?
13
13
  end
14
14
 
15
+ def full_name
16
+ "#{first_name} #{last_name}"
17
+ end
18
+
15
19
  scope :admins, -> { where role: :admin }
16
20
  scope :simple_users, -> { where role: :user }
17
21
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module User
5
- VERSION = '2.1.3.2'
5
+ VERSION = '2.2'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,33 +1,33 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-user
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.3.2
4
+ version: '2.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-04 00:00:00.000000000 Z
11
+ date: 2022-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bcrypt
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 3.1.11
20
- - - ">="
20
+ - - "~>"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 3.1.11
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - "~>"
27
+ - - ">="
28
28
  - !ruby/object:Gem::Version
29
29
  version: 3.1.11
30
- - - ">="
30
+ - - "~>"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 3.1.11
33
33
  - !ruby/object:Gem::Dependency
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  - !ruby/object:Gem::Version
99
99
  version: '0'
100
100
  requirements: []
101
- rubygems_version: 3.1.2
101
+ rubygems_version: 3.0.3.1
102
102
  signing_key:
103
103
  specification_version: 4
104
104
  summary: Engine for users in your Rails app