public
Fork of halorgium/mephisto
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/technoweenie/mephisto.git
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
update acts_as_paranoid plugin

git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@2988 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Thu Oct 04 10:49:51 -0700 2007
commit  c1006d0fcb6517e7a5e975fcc2fd1a341aca905e
tree    ab59e5f0b84a68aa0c26c6715b66738201ea2934
parent  8d3846b8667a714b80337ad61d027ddde1846b87
...
 
 
 
 
1
2
3
...
67
68
69
70
71
 
...
1
2
3
4
5
6
7
...
71
72
73
 
74
75
0
@@ -1,3 +1,7 @@
0
+* (4 Oct 2007)
0
+
0
+Update for Edge rails: remove support for legacy #count args
0
+
0
 * (2 Feb 2007)
0
 
0
 Add support for custom primary keys [Jeff Dean]
0
@@ -67,4 +71,4 @@ Updated for Rails 1.1. I love removing code.
0
 
0
 *0.1* (17 Sep 2005)
0
 
0
-* Initial gem
0
\ No newline at end of file
0
+* Initial gem
...
85
86
87
88
 
89
90
91
...
85
86
87
 
88
89
90
91
0
@@ -85,7 +85,7 @@ module Caboose #:nodoc:
0
           end
0
 
0
           def count_with_deleted(*args)
0
- calculate_with_deleted(:count, *construct_count_options_from_legacy_args(*args))
0
+ calculate_with_deleted(:count, *construct_count_options_from_args(*args))
0
           end
0
 
0
           def count(*args)
...
92
93
94
95
 
96
97
98
...
142
143
144
145
146
147
 
 
 
148
149
150
151
152
153
 
 
 
154
155
156
157
 
158
159
160
...
163
164
165
166
 
167
168
169
...
92
93
94
 
95
96
97
98
...
142
143
144
 
 
 
145
146
147
148
149
150
 
 
 
151
152
153
154
155
156
 
157
158
159
160
...
163
164
165
 
166
167
168
169
0
@@ -92,7 +92,7 @@ class ParanoidTest < Test::Unit::TestCase
0
   
0
   def test_should_not_count_deleted
0
     assert_equal 1, Widget.count
0
- assert_equal 1, Widget.count(['title=?', 'widget 1'])
0
+ assert_equal 1, Widget.count(:all, :conditions => ['title=?', 'widget 1'])
0
     assert_equal 2, Widget.calculate_with_deleted(:count, :all)
0
   end
0
   
0
@@ -142,19 +142,19 @@ class ParanoidTest < Test::Unit::TestCase
0
   end
0
 
0
   def test_should_not_override_scopes_when_counting
0
- assert_equal 1, Widget.with_scope(:find => { :conditions => "title = 'widget 1'" }) { Widget.count }
0
- assert_equal 0, Widget.with_scope(:find => { :conditions => "title = 'deleted widget 2'" }) { Widget.count }
0
- assert_equal 1, Widget.with_scope(:find => { :conditions => "title = 'deleted widget 2'" }) { Widget.calculate_with_deleted(:count, :all) }
0
+ assert_equal 1, Widget.send(:with_scope, :find => { :conditions => "title = 'widget 1'" }) { Widget.count }
0
+ assert_equal 0, Widget.send(:with_scope, :find => { :conditions => "title = 'deleted widget 2'" }) { Widget.count }
0
+ assert_equal 1, Widget.send(:with_scope, :find => { :conditions => "title = 'deleted widget 2'" }) { Widget.calculate_with_deleted(:count, :all) }
0
   end
0
 
0
   def test_should_not_override_scopes_when_finding
0
- assert_equal [1], Widget.with_scope(:find => { :conditions => "title = 'widget 1'" }) { Widget.find(:all) }.ids
0
- assert_equal [], Widget.with_scope(:find => { :conditions => "title = 'deleted widget 2'" }) { Widget.find(:all) }.ids
0
- assert_equal [2], Widget.with_scope(:find => { :conditions => "title = 'deleted widget 2'" }) { Widget.find_with_deleted(:all) }.ids
0
+ assert_equal [1], Widget.send(:with_scope, :find => { :conditions => "title = 'widget 1'" }) { Widget.find(:all) }.ids
0
+ assert_equal [], Widget.send(:with_scope, :find => { :conditions => "title = 'deleted widget 2'" }) { Widget.find(:all) }.ids
0
+ assert_equal [2], Widget.send(:with_scope, :find => { :conditions => "title = 'deleted widget 2'" }) { Widget.find_with_deleted(:all) }.ids
0
   end
0
 
0
   def test_should_allow_multiple_scoped_calls_when_finding
0
- Widget.with_scope(:find => { :conditions => "title = 'deleted widget 2'" }) do
0
+ Widget.send(:with_scope, :find => { :conditions => "title = 'deleted widget 2'" }) do
0
       assert_equal [2], Widget.find_with_deleted(:all).ids
0
       assert_equal [2], Widget.find_with_deleted(:all).ids, "clobbers the constrain on the unmodified find"
0
       assert_equal [], Widget.find(:all).ids
0
@@ -163,7 +163,7 @@ class ParanoidTest < Test::Unit::TestCase
0
   end
0
 
0
   def test_should_allow_multiple_scoped_calls_when_counting
0
- Widget.with_scope(:find => { :conditions => "title = 'deleted widget 2'" }) do
0
+ Widget.send(:with_scope, :find => { :conditions => "title = 'deleted widget 2'" }) do
0
       assert_equal 1, Widget.calculate_with_deleted(:count, :all)
0
       assert_equal 1, Widget.calculate_with_deleted(:count, :all), "clobbers the constrain on the unmodified find"
0
       assert_equal 0, Widget.count

Comments

    No one has commented yet.