File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
test/activerecord_provider/helpers Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 1
1
require 'active_record'
2
+
2
3
module OAI ::Provider
3
4
# = OAI::Provider::ActiveRecordWrapper
4
5
#
@@ -141,7 +142,7 @@ def sql_conditions(opts)
141
142
if opts . has_key? ( :until )
142
143
# Handle databases which store fractions of a second by rounding up
143
144
sql << "#{ timestamp_field } < :until"
144
- esc_values [ :until ] = parse_to_local ( opts [ :until ] ) { |t | round_up ( t ) }
145
+ esc_values [ :until ] = parse_to_local ( opts [ :until ] ) { |t | t . succ }
145
146
end
146
147
if opts . has_key? ( :set )
147
148
sql << "set = :set"
@@ -155,11 +156,7 @@ def sql_conditions(opts)
155
156
def parse_to_local ( time )
156
157
time_obj = Time . parse ( time . to_s )
157
158
time_obj = yield ( time_obj ) if block_given?
158
- time_obj . localtime . to_s
159
- end
160
-
161
- def round_up ( time )
162
- ( time + 1 ) . round ( 0 )
159
+ time_obj . localtime . strftime ( "%Y-%m-%d %H:%M:%S" )
163
160
end
164
161
165
162
end
Original file line number Diff line number Diff line change 1
1
class TransactionalTestCase < Test ::Unit ::TestCase
2
2
3
3
def run ( result , &block )
4
+ # Handle the default "you have no tests" test if it turns up
5
+ return if @method_name . to_s == "default_test"
4
6
ActiveRecord ::Base . transaction do
5
7
load_fixtures
6
8
result = super ( result , &block )
You can’t perform that action at this time.
0 commit comments