Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

develop -> master #3

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions Gemfile
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
source "http://rubygems.org"
source 'http://sellect:devel0pers@gems.kingandpartners.com/'

gem 'rails', "3.0.0.beta4"
gem 'mysql'
gem 'warden'
gem 'devise'
gemspec
76 changes: 76 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
PATH
remote: .
specs:
devise_traceable (0.0.8)
devise
warden

GEM
remote: http://rubygems.org/
specs:
actionpack (3.2.15)
activemodel (= 3.2.15)
activesupport (= 3.2.15)
builder (~> 3.0.0)
erubis (~> 2.7.0)
journey (~> 1.0.4)
rack (~> 1.4.5)
rack-cache (~> 1.2)
rack-test (~> 0.6.1)
sprockets (~> 2.2.1)
activemodel (3.2.15)
activesupport (= 3.2.15)
builder (~> 3.0.0)
activesupport (3.2.15)
i18n (~> 0.6, >= 0.6.4)
multi_json (~> 1.0)
atomic (1.1.14)
bcrypt-ruby (3.1.2)
builder (3.0.4)
devise (3.1.1)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 3.2.6, < 5)
thread_safe (~> 0.1)
warden (~> 1.2.3)
erubis (2.7.0)
hike (1.2.3)
i18n (0.6.5)
journey (1.0.4)
json (1.8.1)
multi_json (1.8.2)
orm_adapter (0.4.0)
rack (1.4.5)
rack-cache (1.2)
rack (>= 0.4)
rack-ssl (1.3.3)
rack
rack-test (0.6.2)
rack (>= 1.0)
railties (3.2.15)
actionpack (= 3.2.15)
activesupport (= 3.2.15)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
rake (10.1.0)
rdoc (3.12.2)
json (~> 1.4)
sprockets (2.2.2)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
thor (0.18.1)
thread_safe (0.1.3)
atomic
tilt (1.4.1)
warden (1.2.3)
rack (>= 1.0)

PLATFORMS
ruby

DEPENDENCIES
devise_traceable!
Empty file modified MIT-LICENSE
100755 → 100644
Empty file.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
= devise_traceable

It adds support to devise[http://github.com/plataformatec/devise] for tracing.

Sellect fork 'traces' user.current_sign_in_ip and user.current_location

Configure devise_traceable inside your app

gem 'devise_traceable', '~> 0.0.8'
33 changes: 0 additions & 33 deletions README.rdoc

This file was deleted.

Empty file modified Rakefile
100755 → 100644
Empty file.
19 changes: 19 additions & 0 deletions devise_traceable.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -*- encoding: utf-8 -*-
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'devise_traceable/version'

Gem::Specification.new do |s|
s.name = "devise_traceable"
s.summary = "Devise Traceable For Traceing Devise Models"
s.description = "Devise Traceable For Traceing Devise Models Logins and Logouts in separate model table"
s.files = `git ls-files`.split($/)
s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
s.require_paths = ["lib"]
s.version = DeviseTraceable::VERSION.dup
s.email = "sukhchander@sellect.com"
s.homepage = "http://github.com/sellect/devise_traceable"
s.author = 'Sukhchander Khanna'
s.add_dependency("warden")
s.add_dependency("devise")
end
2 changes: 1 addition & 1 deletion lib/devise_traceable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
module DeviseTraceable
end

require 'devise_traceable/rails'
require 'devise_traceable/rails'
17 changes: 9 additions & 8 deletions lib/devise_traceable/model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@

module Devise
module Models
# Trace information about your user sign in. It tracks the following columns:

# * resource_id
# * sign_in_at
# * sign_out_at

module Traceable
def stamp!
new_current = Time.now
"#{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)

"#{self.class}Tracing".constantize.create(
ip: self.current_sign_in_ip,
ip_location: self.current_location,
sign_in_at: self.current_sign_in_at,
sign_out_at: new_current,
"#{self.class}".foreign_key.to_sym => self.id
)
end
end
end
end
end
2 changes: 1 addition & 1 deletion lib/devise_traceable/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module DeviseTraceable
VERSION = "0.0.5".freeze
VERSION = "0.0.8".freeze
end