symphonia 3.3.2 → 3.3.3

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: 81d7e486f9226d136f252f53841733cf7fd1f76a84a27b80ff0472cfc574ae30
4
- data.tar.gz: 39fa3ee78ed46669f2dcd583179818e7288fd392c54556b943d7ca2a9b1b312b
3
+ metadata.gz: a94d9e18f62261a832ffb94a8392973d1bc7ecad3c147c9a67bf524fde81d061
4
+ data.tar.gz: 52ab54d867d94ba7029011f416fa854eb34984b33feed8447c920adfb647ca3e
5
5
  SHA512:
6
- metadata.gz: 16fa7bf6a6fbfbb875f0d6bf84c554ecd48ba9d2aacf2c259b361c3e5cb90ac57d448bd1da3c95ab3a1918f18b1a22a05ed3db1517bb36dcc34a4d10e30b7577
7
- data.tar.gz: 4fd6defbf9b4128295eb1c5d90c9ec9476c08e4d80adb58fdcd275cc5998190adad1db771d496cbb97f6ed128d6fafa46109b9b96b320ec892544ebb6c5a3743
6
+ metadata.gz: 98facf3061caf96e02c909469c6812eb07b77f5a8695eee924713e00ab052332949e4d26c9e5cbfea557f2f5c86c441f1568807df52cb5373ebda6d6b3094fe5
7
+ data.tar.gz: fd12db3ba010a729958fa5c11921528db0b36b2c5e614baf359eab19e5472f46c455fed36aeba2c643b43028a7866ca7a4e351666e39536d162706ac26bdf9b4
@@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  ## [Unreleased]
8
+ ## [3.3.3] - 2020-10
9
+ ### Changed
10
+ - prefill login from email
11
+ - allow login edit for legacy accounts
8
12
  ## [3.3.2] - 2020-10-17
9
13
  ### Added
10
14
  - `render_super` for templates
@@ -50,9 +50,6 @@ module Symphonia
50
50
  before_save do |model|
51
51
  Rails.cache.delete_matched('user_allowed_to*') if model.role_id_changed?
52
52
  end
53
- before_validation do |model|
54
- model.login ||= model.email
55
- end
56
53
 
57
54
  def allowed_to?(action)
58
55
  return true if admin?
@@ -1,4 +1,9 @@
1
1
  <div class="row justify-content-center">
2
+ <% if f.object.login != f.object.email %>
3
+ <div class="col-lg-8">
4
+ <%= f.text_field :login, required: true %>
5
+ </div>
6
+ <% end %>
2
7
  <div class="col-lg-8">
3
8
  <%= f.email_field :email, required: true %>
4
9
  </div>
@@ -9,14 +9,12 @@ module Symphonia
9
9
 
10
10
  scope :sorted, -> { order(:first_name, :last_name) }
11
11
 
12
- # validates :mail, uniqueness: true, format: { with: Authlogic::Regex::EMAIL_NONASCII }
13
- # validates :password, presence: true, if: ->(u){ u.new_record? }
14
-
15
12
  validates :email, presence: true, uniqueness: { case_sensitive: false }
16
13
  validates :login, presence: true, uniqueness: { case_sensitive: false }
17
14
  validates :first_name, presence: true
18
15
 
19
16
  before_validation :set_uuid, only: -> { uuid.blank? }
17
+ before_validation :set_login, only: -> { login.blank? }
20
18
 
21
19
  def self.current=(entity)
22
20
  Rails.logger.info("* #{entity.class.name}: #{entity.login} id: #{entity.id}") if entity
@@ -62,6 +60,10 @@ module Symphonia
62
60
  def set_uuid
63
61
  self.uuid ||= SecureRandom.uuid
64
62
  end
63
+
64
+ def set_login
65
+ self.login ||= email
66
+ end
65
67
  end
66
68
  end
67
69
  end
@@ -1,3 +1,3 @@
1
1
  module Symphonia
2
- VERSION = '3.3.2'
2
+ VERSION = '3.3.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: symphonia
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.2
4
+ version: 3.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lukas Pokorny
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-18 00:00:00.000000000 Z
11
+ date: 2020-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -296,14 +296,14 @@ dependencies:
296
296
  requirements:
297
297
  - - "~>"
298
298
  - !ruby/object:Gem::Version
299
- version: 4.0.0.beta
299
+ version: 4.0.0
300
300
  type: :runtime
301
301
  prerelease: false
302
302
  version_requirements: !ruby/object:Gem::Requirement
303
303
  requirements:
304
304
  - - "~>"
305
305
  - !ruby/object:Gem::Version
306
- version: 4.0.0.beta
306
+ version: 4.0.0
307
307
  - !ruby/object:Gem::Dependency
308
308
  name: factory_bot_rails
309
309
  requirement: !ruby/object:Gem::Requirement
@@ -367,7 +367,7 @@ dependencies:
367
367
  - - "~>"
368
368
  - !ruby/object:Gem::Version
369
369
  version: 1.4.2
370
- type: :runtime
370
+ type: :development
371
371
  prerelease: false
372
372
  version_requirements: !ruby/object:Gem::Requirement
373
373
  requirements: