devision 0.0.2.2 → 0.0.2.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
  SHA1:
3
- metadata.gz: d23a43f1e9f17a21a7e7f8f0358c068edbaba290
4
- data.tar.gz: 9b467ada9fc3cd8479b5bcbe54dd12c9cc2f6701
3
+ metadata.gz: b15e07ae7382ffc1153ea795e73667c18a077ddf
4
+ data.tar.gz: b36db7927617a6e1fa1f23ef4159fbe5d8d693da
5
5
  SHA512:
6
- metadata.gz: 4be506909be5a98fc76ec0089af18b4914a945bb3776c24869aee1baa7eaf1eb2f59a77da7b40738647d792919fd7019139be3df556f93e8f75e19a78080db18
7
- data.tar.gz: 2499c3eb142a1809fb551dcc649f89e825a049b1da1a0b9801efee271480cc211741e78232087c5e590b1b5287dfb98c218173b10bcc0ca92ea5af68096dbbad
6
+ metadata.gz: cfcacbd189d5955be5b0950d17a7990816e5ded36a237e4dcbdf77465467ee053863665ac3fe6b9f2b3c88b51dd3b36a4f704e6c02572ef8e5860c1805baba69
7
+ data.tar.gz: ffc7be29a867e9cdf4c26169a162c7bc66c8c9f3d8d7abb2f2b59ad5d69c1d733ebac36041edc50f2646f5576c15a7f43d55692a41fff045cf807a2cc610e71d
@@ -1,4 +1,5 @@
1
1
  module Devision
2
+ module Models
2
3
  module Authenticatable
3
4
 
4
5
  extend ActiveSupport::Concern
@@ -6,7 +7,7 @@ module Devision
6
7
  def self.required_fields(klass)
7
8
  []
8
9
  end
9
-
10
+
10
11
 
11
12
  module ClassMethods
12
13
 
@@ -17,11 +18,11 @@ module Devision
17
18
  def find_or_initialize_with_error_by(attribute, value, error=:invalid)
18
19
  find_or_initialize_with_errors([attribute], { attribute => value }, error)
19
20
  end
20
-
21
+
21
22
  def find_or_initialize_with_errors(required_attributes, attributes, error=:invalid)
22
23
  attributes = attributes.slice(*required_attributes)
23
24
  attributes.delete_if { |key, value| value.blank? }
24
-
25
+
25
26
  if attributes.size == required_attributes.size
26
27
  record = find_first_by_auth_conditions(attributes)
27
28
  end
@@ -34,11 +35,11 @@ module Devision
34
35
  record.errors.add(key, value.present? ? error : :blank)
35
36
  end
36
37
  end
37
-
38
+
38
39
  record
39
40
  end
40
41
 
41
42
  end
42
-
43
+ end
43
44
  end
44
45
  end
@@ -8,7 +8,7 @@ module Devision
8
8
  MAJOR = 0
9
9
  MINOR = 0
10
10
  PATCH = 2
11
- PRE = 2
11
+ PRE = 3
12
12
 
13
13
  STRING = [MAJOR,MINOR,PATCH,PRE].join('.').freeze
14
14
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devision
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2.2
4
+ version: 0.0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Faucett