arkaan 0.4.0 → 0.4.1

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/arkaan/account.rb +16 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4ac83b9b70e1ecb3bca72b55a576c6c73f09b941
4
- data.tar.gz: 6b6e2d509bd95684032a0553807255cbed1209eb
3
+ metadata.gz: 1fb4311fcf313ace86de092814881abb03ee87cc
4
+ data.tar.gz: 33dd28f340ce3f4a2bdb959178ced5633bf621d8
5
5
  SHA512:
6
- metadata.gz: 3e2f8ef7eddb21380844592ae7c9c0a1380a19db6a42d44b567caba5a35c46dc5e791d3eb6f35bdf47c1f70c0a9ac6633b3b281b8f778108f04ffa273d9da312
7
- data.tar.gz: 132672eacf3f19613cb58c6929f5d04575191a0a3a17e57c23897511491371d94a992767951d7508e2ca6161fe6144aea0d254eca067b76afce4eb0e24039886
6
+ metadata.gz: 6bc067b19110d54719aabb180602274704efcb486b16217dec74f9b1782fb5cdb203e96ddfb4a936115ae92f0d7e46d47ef7dca6596212b0bbc6338130c5ed19
7
+ data.tar.gz: 0e137e7109c4ef70bd2fb898f8224fcbca56e41942a4876a29d0f2dd23e0682efe3a3c9f9705056e653bbf7411ea30b83bc92a7eb5f08500b3e14c51711573b9
@@ -29,7 +29,7 @@ module Arkaan
29
29
  # @return [String] password, in clear, of the user ; do not attempt to get the value, just set it when changing the password.
30
30
  # @!attribute [w] password_confirmation
31
31
  # @return [String] the confirmation of the password, do not get, just set it ; it must be the same as the password.
32
- has_secure_password
32
+ has_secure_password validations: false
33
33
 
34
34
  # @!attribute [rw] groups
35
35
  # @return [Array<Arkaan::Permissions::Group>] the groups giving their corresponding rights to the current account.
@@ -41,8 +41,21 @@ module Arkaan
41
41
  # @return [Array<Arkaan::OAuth::Authorization>] the authorization issued by this account to third-party applications to access its data.
42
42
  has_many :authorizations, class_name: 'Arkaan::OAuth::Authorization', inverse_of: :account
43
43
 
44
- validates :username, length: {minimum: 6}, uniqueness: true
44
+ validates :username,
45
+ presence: {message: 'account.username.blank'},
46
+ length: {minimum: 6, message: 'account.username.short'},
47
+ uniqueness: {message: 'account.username.uniq'}
45
48
 
46
- validates :email, presence: true, format: {with: /\A[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}\z/}, uniqueness: true
49
+ validates :email,
50
+ presence: {message: 'account.email.blank'},
51
+ format: {with: /\A[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}\z/, message: 'account.email.format'},
52
+ uniqueness: {message: 'account.email.uniq'}
53
+
54
+ validates :password,
55
+ presence: {message: 'account.password.blank'},
56
+ confirmation: {message: 'account.password.confirmation', if: :password_digest_changed?}
57
+
58
+ validates :password_confirmation,
59
+ presence: {message: 'account.password_confirmation.blank', if: :password_digest_changed?}
47
60
  end
48
61
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arkaan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vincent Courtois
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-12 00:00:00.000000000 Z
11
+ date: 2017-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec