vizjerai-devise_security_extension 0.3.6 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.6
1
+ 0.3.7
@@ -9,7 +9,7 @@ module Devise # :nodoc:
9
9
 
10
10
  base.class_eval do
11
11
  include InstanceMethods
12
- has_many :old_passwords, :as => :password_archivable, :class_name => "OldPassword"
12
+ has_many :old_passwords, :as => :password_archivable, :dependent => :destroy
13
13
  before_update :archive_password
14
14
  validate :validate_password_archive
15
15
  end
@@ -40,11 +40,12 @@ module Devise
40
40
  end
41
41
 
42
42
  def current_equal_password_validation
43
- return if self.new_record?
44
- dummy = self.class.new
45
- dummy.encrypted_password = self.encrypted_password
46
- dummy.password_salt = self.password_salt
47
- self.errors.add(:password, :equal_to_current_password) if dummy.valid_password?(self.password)
43
+ unless self.encrypted_password_change.nil?
44
+ dummy = self.class.new
45
+ dummy.encrypted_password = self.encrypted_password_change.first
46
+ dummy.password_salt = self.password_salt_change.first
47
+ self.errors.add(:password, :equal_to_current_password) if dummy.valid_password?(self.password)
48
+ end
48
49
  end
49
50
 
50
51
  protected
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{vizjerai-devise_security_extension}
8
- s.version = "0.3.6"
8
+ s.version = "0.3.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Marco Scholl"]
12
- s.date = %q{2011-03-08}
12
+ s.date = %q{2011-03-11}
13
13
  s.description = %q{a gem for extend devise for more password security}
14
14
  s.email = %q{team@phatworx.de}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vizjerai-devise_security_extension
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 6
10
- version: 0.3.6
9
+ - 7
10
+ version: 0.3.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Marco Scholl
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-08 00:00:00 -06:00
18
+ date: 2011-03-11 00:00:00 -06:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency