arkaan 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/arkaan/account.rb +16 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fb4311fcf313ace86de092814881abb03ee87cc
|
4
|
+
data.tar.gz: 33dd28f340ce3f4a2bdb959178ced5633bf621d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bc067b19110d54719aabb180602274704efcb486b16217dec74f9b1782fb5cdb203e96ddfb4a936115ae92f0d7e46d47ef7dca6596212b0bbc6338130c5ed19
|
7
|
+
data.tar.gz: 0e137e7109c4ef70bd2fb898f8224fcbca56e41942a4876a29d0f2dd23e0682efe3a3c9f9705056e653bbf7411ea30b83bc92a7eb5f08500b3e14c51711573b9
|
data/lib/arkaan/account.rb
CHANGED
@@ -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,
|
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,
|
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.
|
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-
|
11
|
+
date: 2017-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|