backframe 0.0.17 → 0.0.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/backframe/activerecord/acts_as_user.rb +7 -3
- data/lib/backframe/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2d16e9961a4c46a0fb8c7f49c47355259532424
|
4
|
+
data.tar.gz: 2c8118e5a6fbc036b8dacbcaed3a9948c1e1335e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 017b849bb8b85110cfc8d106c47a78015fe5113a56e93c19c373683e392ba8f4dc80f807ad9826f2ad854238c5773f6fce18f0b7481bac004fd61e5903a41d9a
|
7
|
+
data.tar.gz: 943cef19a3a4b277a13b56b72b3769a6b0feb5653c014287cb11e98cedf8ec587598de0e1dcacf23ef4befb53c94b4a11d0bf3159469e91621da41d12003ef28
|
@@ -10,12 +10,16 @@ module Backframe
|
|
10
10
|
|
11
11
|
module ClassMethods
|
12
12
|
|
13
|
-
def acts_as_user
|
13
|
+
def acts_as_user(*args)
|
14
|
+
arguments = args[0]
|
15
|
+
|
16
|
+
reset = arguments[:reset] || 'Backframe::Reset'
|
17
|
+
activation = arguments[:activation] || 'Backframe::Activation'
|
14
18
|
|
15
19
|
attr_accessor :password, :change_password, :set_password, :old_password, :new_password, :confirm_password, :confirm_email
|
16
20
|
|
17
|
-
has_many :activations, :class_name =>
|
18
|
-
has_many :resets, :class_name =>
|
21
|
+
has_many :activations, :class_name => reset, :dependent => :destroy, :as => :user
|
22
|
+
has_many :resets, :class_name => activation, :dependent => :destroy, :as => :user
|
19
23
|
|
20
24
|
after_validation :set_new_password, :if => Proc.new { |u| u.new_password.present? }
|
21
25
|
after_create :activate
|
data/lib/backframe/version.rb
CHANGED