devise_traceable 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
@@ -7,12 +7,11 @@ module Devise
|
|
7
7
|
# * resource_id
|
8
8
|
# * sign_in_at
|
9
9
|
# * sign_out_at
|
10
|
-
|
11
|
-
|
10
|
+
|
12
11
|
module Traceable
|
13
|
-
def
|
12
|
+
def stamp!
|
14
13
|
new_current = Time.now
|
15
|
-
"#{self.class}Tracing".constantize.create(:sign_in_at => self.current_sign_in_at, :sign_out_at => new_current,
|
14
|
+
"#{self.class}Tracing".constantize.create(:sign_in_at => self.current_sign_in_at, :sign_out_at => new_current, "#{self.class}".foreign_key.to_sym => self.id)
|
16
15
|
end
|
17
16
|
end
|
18
17
|
end
|
@@ -5,8 +5,7 @@ class DeviseCreate<%= table_name.camelize.singularize %>Tracings < ActiveRecord:
|
|
5
5
|
t.datetime :sign_in_at
|
6
6
|
t.datetime :sign_out_at
|
7
7
|
#Any additional fields here
|
8
|
-
|
9
|
-
t.timestamps
|
8
|
+
#t.timestamps
|
10
9
|
end
|
11
10
|
|
12
11
|
add_index :<%= table_name.singularize %>_tracings, :<%= table_name.classify.foreign_key %>
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 5
|
9
|
+
version: 0.0.5
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Shenouda Bertel
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-06-
|
17
|
+
date: 2010-06-18 00:00:00 +03:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|