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.
@@ -4,7 +4,7 @@
4
4
  # not trigger it.
5
5
 
6
6
  Warden::Manager.before_logout do |record, warden, opts|
7
- if record.respond_to?(:trace!)
8
- record.trace!
7
+ if record.respond_to?(:stamp!)
8
+ record.stamp!
9
9
  end
10
10
  end
@@ -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 trace!
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, :"#{self.class.primary_key}" => self.id)
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
@@ -1,3 +1,3 @@
1
1
  module DeviseTraceable
2
- VERSION = "0.0.4".freeze
2
+ VERSION = "0.0.5".freeze
3
3
  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
- - 4
9
- version: 0.0.4
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 00:00:00 +03:00
17
+ date: 2010-06-18 00:00:00 +03:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency