tramway-user 2.1.2 → 2.1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/decorators/tramway/user/user_decorator.rb +11 -9
- data/app/forms/admin/tramway/user/user_form.rb +5 -2
- data/app/models/tramway/user/user.rb +3 -0
- data/lib/tramway/user/generators/templates/add_phone_to_tramway_user_users.rb +2 -0
- data/lib/tramway/user/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48763df0538d0bf92c0538e45efd0df70ff017b050d9ed26d25525ccd64d77c0
|
4
|
+
data.tar.gz: 4c3d2c389e2dbeeb35e58bb5bcdaf4d4cb6f333f18f460124d9c03a3f7887230
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6f5408f00e456b0d3c06faa5b897d294c68eef5d76a15fec690512153732dd839c30e03e5d152d0144ca49d883e7aa911b1baed23bd07bed25791567e62f80b
|
7
|
+
data.tar.gz: 571f6c1500d1a6857edde7048af7c5da7da1f4863dfd7b351f12ab2ef5401dd4914ef29e8228c9639bba5b7caed34b36847631f922b7540178b93332598b2bb6
|
@@ -11,19 +11,21 @@ class Tramway::User::UserDecorator < ::Tramway::Core::ApplicationDecorator
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def show_attributes
|
14
|
-
[
|
14
|
+
%i[email first_name last_name phone role created_at updated_at]
|
15
|
+
end
|
16
|
+
|
17
|
+
if defined? Tramway::Conference
|
18
|
+
def show_associations
|
19
|
+
[:social_networks]
|
20
|
+
end
|
15
21
|
end
|
16
22
|
end
|
17
23
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
delegate :phone, to: :object
|
22
|
-
delegate :role, to: :object
|
23
|
-
delegate :created_at, to: :object
|
24
|
-
delegate :updated_at, to: :object
|
24
|
+
decorate_association :social_networks, as: :record if defined? Tramway::Conference
|
25
|
+
|
26
|
+
delegate_attributes :first_name, :last_name, :email, :phone, :role, :created_at, :updated_at, :admin?
|
25
27
|
|
26
28
|
def name
|
27
|
-
"#{object
|
29
|
+
"#{object&.first_name} #{object&.last_name}"
|
28
30
|
end
|
29
31
|
end
|
@@ -1,11 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
class Admin::Tramway::User::UserForm < ::Tramway::Core::ApplicationForm
|
4
|
-
self.model_class = Tramway::User::User
|
4
|
+
self.model_class = Tramway::User::User.is_active
|
5
5
|
|
6
6
|
properties :email, :password, :first_name, :last_name, :role, :phone
|
7
7
|
|
8
|
-
|
8
|
+
#fix me
|
9
|
+
unless self.model_class.columns_hash['project_id'].present?
|
10
|
+
validates :email, email: true, uniqueness: true, on: :destroy
|
11
|
+
end
|
9
12
|
|
10
13
|
def initialize(object)
|
11
14
|
super(object).tap do
|
@@ -3,6 +3,8 @@
|
|
3
3
|
class Tramway::User::User < ::Tramway::Core::ApplicationRecord
|
4
4
|
has_secure_password
|
5
5
|
|
6
|
+
has_many :social_networks, as: :record, class_name: 'Tramway::Profiles::SocialNetwork' if defined? Tramway::Conference
|
7
|
+
|
6
8
|
# FIXME: replace to tramway-admin
|
7
9
|
enumerize :role, in: %i[user admin], default: :admin
|
8
10
|
|
@@ -12,4 +14,5 @@ class Tramway::User::User < ::Tramway::Core::ApplicationRecord
|
|
12
14
|
|
13
15
|
scope :admins, -> { where role: :admin }
|
14
16
|
scope :simple_users, -> { where role: :user }
|
17
|
+
scope :is_active, -> { where state: :active }
|
15
18
|
end
|
data/lib/tramway/user/version.rb
CHANGED
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.
|
4
|
+
version: 2.1.3.3
|
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-
|
11
|
+
date: 2020-08-30 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.
|
101
|
+
rubygems_version: 3.1.2
|
102
102
|
signing_key:
|
103
103
|
specification_version: 4
|
104
104
|
summary: Engine for users in your Rails app
|