Skip to content

Commit c2ef11b

Browse files
committed
remove the simple / pointless generator
1 parent 7aed570 commit c2ef11b

File tree

8 files changed

+29
-50
lines changed

8 files changed

+29
-50
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
source :rubygems
2-
gemspec
2+
gemspec

Gemfile.lock

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,25 @@ PATH
88
GEM
99
remote: http://rubygems.org/
1010
specs:
11-
activemodel (3.2.6)
12-
activesupport (= 3.2.6)
11+
activemodel (3.2.9)
12+
activesupport (= 3.2.9)
1313
builder (~> 3.0.0)
14-
activerecord (3.2.6)
15-
activemodel (= 3.2.6)
16-
activesupport (= 3.2.6)
14+
activerecord (3.2.9)
15+
activemodel (= 3.2.9)
16+
activesupport (= 3.2.9)
1717
arel (~> 3.0.2)
1818
tzinfo (~> 0.3.29)
19-
activesupport (3.2.6)
19+
activesupport (3.2.9)
2020
i18n (~> 0.6)
2121
multi_json (~> 1.0)
2222
arel (3.0.2)
2323
bcrypt-ruby (3.0.1)
24-
builder (3.0.0)
25-
i18n (0.6.0)
26-
multi_json (1.3.6)
27-
rake (0.9.2.2)
24+
builder (3.0.4)
25+
i18n (0.6.1)
26+
multi_json (1.4.0)
27+
rake (10.0.2)
2828
sqlite3 (1.3.6)
29-
tzinfo (0.3.33)
29+
tzinfo (0.3.35)
3030

3131
PLATFORMS
3232
ruby

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
require 'rubygems'
2-
require 'rake'
2+
require 'bundler'
33

44
Bundler.setup
55

lib/authlogic/acts_as_authentic/logged_in_status.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def self.included(klass)
3131

3232
klass.class_eval do
3333
include InstanceMethods
34-
scope :logged_in, lambda{ where("last_request_at > ? and last_login_at IS NOT NULL", logged_in_timeout.seconds.ago) }
34+
scope :logged_in, lambda{ where("last_request_at > ? and current_login_at IS NOT NULL", logged_in_timeout.seconds.ago) }
3535
scope :logged_out, lambda{ where("last_request_at is NULL or last_request_at <= ?", logged_in_timeout.seconds.ago) }
3636
end
3737
end

lib/generators/authlogic/USAGE

Lines changed: 0 additions & 8 deletions
This file was deleted.

lib/generators/authlogic/session_generator.rb

Lines changed: 0 additions & 14 deletions
This file was deleted.

lib/generators/authlogic/templates/session.rb

Lines changed: 0 additions & 2 deletions
This file was deleted.

test/acts_as_authentic_test/logged_in_status_test.rb

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,44 @@
33
module ActsAsAuthenticTest
44
class LoggedInStatusTest < ActiveSupport::TestCase
55
ERROR_MSG = 'Multiple calls to %s should result in different relations'
6-
6+
77
def test_logged_in_timeout_config
88
assert_equal 10.minutes.to_i, User.logged_in_timeout
99
assert_equal 10.minutes.to_i, Employee.logged_in_timeout
10-
10+
1111
User.logged_in_timeout = 1.hour
1212
assert_equal 1.hour.to_i, User.logged_in_timeout
1313
User.logged_in_timeout 10.minutes
1414
assert_equal 10.minutes.to_i, User.logged_in_timeout
1515
end
16-
16+
1717
def test_named_scope_logged_in
18-
# Testing that the scope returned differs, because the time it was called should be
19-
# slightly different. This is an attempt to make sure the scope is lambda wrapped
18+
# Testing that the scope returned differs, because the time it was called should be
19+
# slightly different. This is an attempt to make sure the scope is lambda wrapped
2020
# so that it is re-evaluated every time its called. My biggest concern is that the
2121
# test happens so fast that the test fails... I just don't know a better way to test it!
2222
assert User.logged_in.where_values != User.logged_in.where_values, ERROR_MSG % '#logged_in'
23-
23+
2424
assert_equal 0, User.logged_in.count
25-
User.first.update_attribute(:last_request_at, Time.now)
25+
user = User.first
26+
user.last_request_at = Time.now
27+
user.current_login_at = Time.now
28+
user.save!
2629
assert_equal 1, User.logged_in.count
2730
end
28-
31+
2932
def test_named_scope_logged_out
30-
# Testing that the scope returned differs, because the time it was called should be
31-
# slightly different. This is an attempt to make sure the scope is lambda wrapped
33+
# Testing that the scope returned differs, because the time it was called should be
34+
# slightly different. This is an attempt to make sure the scope is lambda wrapped
3235
# so that it is re-evaluated every time its called. My biggest concern is that the
3336
# test happens so fast that the test fails... I just don't know a better way to test it!
3437
assert User.logged_in.where_values != User.logged_out.where_values, ERROR_MSG % '#logged_out'
35-
38+
3639
assert_equal 2, User.logged_out.count
3740
User.first.update_attribute(:last_request_at, Time.now)
3841
assert_equal 1, User.logged_out.count
3942
end
40-
43+
4144
def test_logged_in_logged_out
4245
u = User.first
4346
assert !u.logged_in?

0 commit comments

Comments
 (0)