| 1 |
Index: actionmailer/test/mail_service_test.rb |
|---|
| 2 |
=================================================================== |
|---|
| 3 |
--- actionmailer/test/mail_service_test.rb (revision 1873) |
|---|
| 4 |
+++ actionmailer/test/mail_service_test.rb (working copy) |
|---|
| 5 |
@@ -18,8 +18,11 @@ |
|---|
| 6 |
end |
|---|
| 7 |
|
|---|
| 8 |
class Net::SMTP |
|---|
| 9 |
- def self.start(*args) |
|---|
| 10 |
- yield MockSMTP.new |
|---|
| 11 |
+ class << self |
|---|
| 12 |
+ alias old_start start |
|---|
| 13 |
+ def start(*args) |
|---|
| 14 |
+ yield MockSMTP.new |
|---|
| 15 |
+ end |
|---|
| 16 |
end |
|---|
| 17 |
end |
|---|
| 18 |
|
|---|
| 19 |
Index: actionmailer/Rakefile |
|---|
| 20 |
=================================================================== |
|---|
| 21 |
--- actionmailer/Rakefile (revision 1873) |
|---|
| 22 |
+++ actionmailer/Rakefile (working copy) |
|---|
| 23 |
@@ -24,6 +24,7 @@ |
|---|
| 24 |
t.libs << "test" |
|---|
| 25 |
t.pattern = 'test/*_test.rb' |
|---|
| 26 |
t.verbose = true |
|---|
| 27 |
+ t.warning = true |
|---|
| 28 |
} |
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
@@ -194,4 +195,4 @@ |
|---|
| 32 |
first_file = false |
|---|
| 33 |
end |
|---|
| 34 |
end |
|---|
| 35 |
-end |
|---|
| 36 |
\ No newline at end of file |
|---|
| 37 |
+end |
|---|
| 38 |
Index: actionmailer/lib/action_mailer/adv_attr_accessor.rb |
|---|
| 39 |
=================================================================== |
|---|
| 40 |
--- actionmailer/lib/action_mailer/adv_attr_accessor.rb (revision 1873) |
|---|
| 41 |
+++ actionmailer/lib/action_mailer/adv_attr_accessor.rb (working copy) |
|---|
| 42 |
@@ -26,31 +26,3 @@ |
|---|
| 43 |
end |
|---|
| 44 |
end |
|---|
| 45 |
|
|---|
| 46 |
-module ActionMailer |
|---|
| 47 |
- module AdvAttrAccessor #:nodoc: |
|---|
| 48 |
- def self.append_features(base) |
|---|
| 49 |
- super |
|---|
| 50 |
- base.extend(ClassMethods) |
|---|
| 51 |
- end |
|---|
| 52 |
- |
|---|
| 53 |
- module ClassMethods #:nodoc: |
|---|
| 54 |
- def adv_attr_accessor(*names) |
|---|
| 55 |
- names.each do |name| |
|---|
| 56 |
- define_method("#{name}=") do |value| |
|---|
| 57 |
- instance_variable_set("@#{name}", value) |
|---|
| 58 |
- end |
|---|
| 59 |
- |
|---|
| 60 |
- define_method(name) do |*parameters| |
|---|
| 61 |
- raise ArgumentError, "expected 0 or 1 parameters" unless parameters.length <= 1 |
|---|
| 62 |
- if parameters.empty? |
|---|
| 63 |
- instance_variable_get("@#{name}") |
|---|
| 64 |
- else |
|---|
| 65 |
- instance_variable_set("@#{name}", parameters.first) |
|---|
| 66 |
- end |
|---|
| 67 |
- end |
|---|
| 68 |
- end |
|---|
| 69 |
- end |
|---|
| 70 |
- |
|---|
| 71 |
- end |
|---|
| 72 |
- end |
|---|
| 73 |
-end |
|---|
| 74 |
Index: actionmailer/lib/action_mailer/quoting.rb |
|---|
| 75 |
=================================================================== |
|---|
| 76 |
--- actionmailer/lib/action_mailer/quoting.rb (revision 1873) |
|---|
| 77 |
+++ actionmailer/lib/action_mailer/quoting.rb (working copy) |
|---|
| 78 |
@@ -46,54 +46,3 @@ |
|---|
| 79 |
end |
|---|
| 80 |
end |
|---|
| 81 |
end |
|---|
| 82 |
- |
|---|
| 83 |
-module ActionMailer |
|---|
| 84 |
- module Quoting #:nodoc: |
|---|
| 85 |
- # Convert the given text into quoted printable format, with an instruction |
|---|
| 86 |
- # that the text be eventually interpreted in the given charset. |
|---|
| 87 |
- def quoted_printable(text, charset) |
|---|
| 88 |
- text = text.gsub( /[^a-z ]/i ) { "=%02x" % $&[0] }.gsub( / /, "_" ) |
|---|
| 89 |
- "=?#{charset}?Q?#{text}?=" |
|---|
| 90 |
- end |
|---|
| 91 |
- |
|---|
| 92 |
- # A quick-and-dirty regexp for determining whether a string contains any |
|---|
| 93 |
- # characters that need escaping. |
|---|
| 94 |
- if !defined?(CHARS_NEEDING_QUOTING) |
|---|
| 95 |
- CHARS_NEEDING_QUOTING = /[\000-\011\013\014\016-\037\177-\377]/ |
|---|
| 96 |
- end |
|---|
| 97 |
- |
|---|
| 98 |
- # Quote the given text if it contains any "illegal" characters |
|---|
| 99 |
- def quote_if_necessary(text, charset) |
|---|
| 100 |
- (text =~ CHARS_NEEDING_QUOTING) ? |
|---|
| 101 |
- quoted_printable(text, charset) : |
|---|
| 102 |
- text |
|---|
| 103 |
- end |
|---|
| 104 |
- |
|---|
| 105 |
- # Quote any of the given strings if they contain any "illegal" characters |
|---|
| 106 |
- def quote_any_if_necessary(charset, *args) |
|---|
| 107 |
- args.map { |v| quote_if_necessary(v, charset) } |
|---|
| 108 |
- end |
|---|
| 109 |
- |
|---|
| 110 |
- # Quote the given address if it needs to be. The address may be a |
|---|
| 111 |
- # regular email address, or it can be a phrase followed by an address in |
|---|
| 112 |
- # brackets. The phrase is the only part that will be quoted, and only if |
|---|
| 113 |
- # it needs to be. This allows extended characters to be used in the |
|---|
| 114 |
- # "to", "from", "cc", and "bcc" headers. |
|---|
| 115 |
- def quote_address_if_necessary(address, charset) |
|---|
| 116 |
- if Array === address |
|---|
| 117 |
- address.map { |a| quote_address_if_necessary(a, charset) } |
|---|
| 118 |
- elsif address =~ /^(\S.*)\s+(<.*>)$/ |
|---|
| 119 |
- address = $2 |
|---|
| 120 |
- phrase = quote_if_necessary($1.gsub(/^['"](.*)['"]$/, '\1'), charset) |
|---|
| 121 |
- "\"#{phrase}\" #{address}" |
|---|
| 122 |
- else |
|---|
| 123 |
- address |
|---|
| 124 |
- end |
|---|
| 125 |
- end |
|---|
| 126 |
- |
|---|
| 127 |
- # Quote any of the given addresses, if they need to be. |
|---|
| 128 |
- def quote_any_address_if_necessary(charset, *args) |
|---|
| 129 |
- args.map { |v| quote_address_if_necessary(v, charset) } |
|---|
| 130 |
- end |
|---|
| 131 |
- end |
|---|
| 132 |
-end |
|---|
| 133 |
Index: actionmailer/lib/action_mailer/vendor/text/format.rb |
|---|
| 134 |
=================================================================== |
|---|
| 135 |
--- actionmailer/lib/action_mailer/vendor/text/format.rb (revision 1873) |
|---|
| 136 |
+++ actionmailer/lib/action_mailer/vendor/text/format.rb (working copy) |
|---|
| 137 |
@@ -831,7 +831,7 @@ |
|---|
| 138 |
|
|---|
| 139 |
def __create(arg = nil, &block) #:nodoc: |
|---|
| 140 |
# Format::Text.new(text-to-wrap) |
|---|
| 141 |
- @text = arg unless arg.nil? |
|---|
| 142 |
+ @text = arg.nil? ? nil : arg |
|---|
| 143 |
# Defaults |
|---|
| 144 |
@columns = 72 |
|---|
| 145 |
@tabstop = 8 |
|---|
| 146 |
Index: actionmailer/lib/action_mailer/vendor/tmail/facade.rb |
|---|
| 147 |
=================================================================== |
|---|
| 148 |
--- actionmailer/lib/action_mailer/vendor/tmail/facade.rb (revision 1873) |
|---|
| 149 |
+++ actionmailer/lib/action_mailer/vendor/tmail/facade.rb (working copy) |
|---|
| 150 |
@@ -464,6 +464,8 @@ |
|---|
| 151 |
### utils |
|---|
| 152 |
### |
|---|
| 153 |
|
|---|
| 154 |
+ alias old_create_reply create_reply |
|---|
| 155 |
+ |
|---|
| 156 |
def create_reply |
|---|
| 157 |
mail = TMail::Mail.parse('') |
|---|
| 158 |
mail.subject = 'Re: ' + subject('').sub(/\A(?:\[[^\]]+\])?(?:\s*Re:)*\s*/i, '') |
|---|
| 159 |
Index: activesupport/test/inflector_test.rb |
|---|
| 160 |
=================================================================== |
|---|
| 161 |
--- activesupport/test/inflector_test.rb (revision 1873) |
|---|
| 162 |
+++ activesupport/test/inflector_test.rb (working copy) |
|---|
| 163 |
@@ -1,5 +1,5 @@ |
|---|
| 164 |
require 'test/unit' |
|---|
| 165 |
-require File.dirname(__FILE__) + '/../lib/active_support/inflector' |
|---|
| 166 |
+require File.dirname(__FILE__) + '/../lib/active_support/inflector' unless defined? Inflector |
|---|
| 167 |
|
|---|
| 168 |
module Ace |
|---|
| 169 |
module Base |
|---|
| 170 |
Index: activesupport/Rakefile |
|---|
| 171 |
=================================================================== |
|---|
| 172 |
--- activesupport/Rakefile (revision 1873) |
|---|
| 173 |
+++ activesupport/Rakefile (working copy) |
|---|
| 174 |
@@ -16,6 +16,7 @@ |
|---|
| 175 |
task :default => :test |
|---|
| 176 |
Rake::TestTask.new { |t| |
|---|
| 177 |
t.pattern = 'test/**/*_test.rb' |
|---|
| 178 |
+ t.warning = true |
|---|
| 179 |
} |
|---|
| 180 |
|
|---|
| 181 |
# Create compressed packages |
|---|
| 182 |
@@ -180,4 +181,4 @@ |
|---|
| 183 |
first_file = false |
|---|
| 184 |
end |
|---|
| 185 |
end |
|---|
| 186 |
-end |
|---|
| 187 |
\ No newline at end of file |
|---|
| 188 |
+end |
|---|
| 189 |
Index: activesupport/lib/active_support/breakpoint.rb |
|---|
| 190 |
=================================================================== |
|---|
| 191 |
--- activesupport/lib/active_support/breakpoint.rb (revision 1873) |
|---|
| 192 |
+++ activesupport/lib/active_support/breakpoint.rb (working copy) |
|---|
| 193 |
@@ -16,7 +16,7 @@ |
|---|
| 194 |
# license please contact me. |
|---|
| 195 |
|
|---|
| 196 |
require 'irb' |
|---|
| 197 |
-require File.dirname(__FILE__) + '/binding_of_caller' |
|---|
| 198 |
+require File.dirname(__FILE__) + '/binding_of_caller' unless defined? Binding.of_caller |
|---|
| 199 |
require 'drb' |
|---|
| 200 |
require 'drb/acl' |
|---|
| 201 |
|
|---|
| 202 |
@@ -460,6 +460,10 @@ |
|---|
| 203 |
old_CurrentContext |
|---|
| 204 |
end |
|---|
| 205 |
end |
|---|
| 206 |
+ class << self |
|---|
| 207 |
+ alias old_parse_opts parse_opts |
|---|
| 208 |
+ remove_method :parse_opts |
|---|
| 209 |
+ end |
|---|
| 210 |
def IRB.parse_opts() end |
|---|
| 211 |
|
|---|
| 212 |
class Context #:nodoc: |
|---|
| 213 |
Index: activesupport/lib/active_support/class_inheritable_attributes.rb |
|---|
| 214 |
=================================================================== |
|---|
| 215 |
--- activesupport/lib/active_support/class_inheritable_attributes.rb (revision 1873) |
|---|
| 216 |
+++ activesupport/lib/active_support/class_inheritable_attributes.rb (working copy) |
|---|
| 217 |
@@ -113,5 +113,8 @@ |
|---|
| 218 |
if respond_to?(:inherited) |
|---|
| 219 |
alias_method :inherited_without_inheritable_attributes, :inherited |
|---|
| 220 |
end |
|---|
| 221 |
- alias_method :inherited, :inherited_with_inheritable_attributes |
|---|
| 222 |
+ |
|---|
| 223 |
+ alias old_inherited inherited |
|---|
| 224 |
+ alias inherited inherited_with_inheritable_attributes |
|---|
| 225 |
+ |
|---|
| 226 |
end |
|---|
| 227 |
Index: activesupport/lib/active_support/clean_logger.rb |
|---|
| 228 |
=================================================================== |
|---|
| 229 |
--- activesupport/lib/active_support/clean_logger.rb (revision 1873) |
|---|
| 230 |
+++ activesupport/lib/active_support/clean_logger.rb (working copy) |
|---|
| 231 |
@@ -12,7 +12,8 @@ |
|---|
| 232 |
private |
|---|
| 233 |
remove_const "Format" |
|---|
| 234 |
Format = "%s\n" |
|---|
| 235 |
+ alias old_format_message format_message |
|---|
| 236 |
def format_message(severity, timestamp, msg, progname) |
|---|
| 237 |
Format % [msg] |
|---|
| 238 |
end |
|---|
| 239 |
-end |
|---|
| 240 |
\ No newline at end of file |
|---|
| 241 |
+end |
|---|
| 242 |
Index: activesupport/lib/active_support/core_ext/integer/inflections.rb |
|---|
| 243 |
=================================================================== |
|---|
| 244 |
--- activesupport/lib/active_support/core_ext/integer/inflections.rb (revision 1873) |
|---|
| 245 |
+++ activesupport/lib/active_support/core_ext/integer/inflections.rb (working copy) |
|---|
| 246 |
@@ -1,4 +1,4 @@ |
|---|
| 247 |
-require File.dirname(__FILE__) + '/../../inflector' |
|---|
| 248 |
+require File.dirname(__FILE__) + '/../../inflector' unless defined? Inflector |
|---|
| 249 |
module ActiveSupport #:nodoc: |
|---|
| 250 |
module CoreExtensions #:nodoc: |
|---|
| 251 |
module Integer #:nodoc: |
|---|
| 252 |
Index: activesupport/lib/active_support/core_ext/string/inflections.rb |
|---|
| 253 |
=================================================================== |
|---|
| 254 |
--- activesupport/lib/active_support/core_ext/string/inflections.rb (revision 1873) |
|---|
| 255 |
+++ activesupport/lib/active_support/core_ext/string/inflections.rb (working copy) |
|---|
| 256 |
@@ -1,4 +1,4 @@ |
|---|
| 257 |
-require File.dirname(__FILE__) + '/../../inflector' |
|---|
| 258 |
+require File.dirname(__FILE__) + '/../../inflector' unless defined? Inflector |
|---|
| 259 |
module ActiveSupport #:nodoc: |
|---|
| 260 |
module CoreExtensions #:nodoc: |
|---|
| 261 |
module String #:nodoc: |
|---|
| 262 |
Index: activesupport/lib/active_support/dependencies.rb |
|---|
| 263 |
=================================================================== |
|---|
| 264 |
--- activesupport/lib/active_support/dependencies.rb (revision 1873) |
|---|
| 265 |
+++ activesupport/lib/active_support/dependencies.rb (working copy) |
|---|
| 266 |
@@ -172,6 +172,9 @@ |
|---|
| 267 |
Object.send(:define_method, :require_association) { |file_name| Dependencies.associate_with(file_name) } unless Object.respond_to?(:require_association) |
|---|
| 268 |
|
|---|
| 269 |
class Module #:nodoc: |
|---|
| 270 |
+ |
|---|
| 271 |
+ alias old_const_missing const_missing |
|---|
| 272 |
+ |
|---|
| 273 |
# Use const_missing to autoload associations so we don't have to |
|---|
| 274 |
# require_association when using single-table inheritance. |
|---|
| 275 |
def const_missing(class_id) |
|---|
| 276 |
Index: activerecord/test/deprecated_associations_test.rb |
|---|
| 277 |
=================================================================== |
|---|
| 278 |
--- activerecord/test/deprecated_associations_test.rb (revision 1873) |
|---|
| 279 |
+++ activerecord/test/deprecated_associations_test.rb (working copy) |
|---|
| 280 |
@@ -113,17 +113,6 @@ |
|---|
| 281 |
assert_raises(RuntimeError) { !Company.find(3).firm?(Company.find(3)) } # "Summit shouldn't have itself as firm" |
|---|
| 282 |
end |
|---|
| 283 |
|
|---|
| 284 |
- def test_has_one |
|---|
| 285 |
- assert companies(:first_firm).account?(Account.find(1)) |
|---|
| 286 |
- assert_equal Account.find(1).credit_limit, companies(:first_firm).account.credit_limit |
|---|
| 287 |
- assert companies(:first_firm).has_account?, "37signals should have an account" |
|---|
| 288 |
- assert Account.find(1).firm?(companies(:first_firm)), "37signals account should be able to backtrack" |
|---|
| 289 |
- assert Account.find(1).has_firm?, "37signals account should be able to backtrack" |
|---|
| 290 |
- |
|---|
| 291 |
- assert !Account.find(2).has_firm?, "Unknown isn't linked" |
|---|
| 292 |
- assert !Account.find(2).firm?(companies(:first_firm)), "Unknown isn't linked" |
|---|
| 293 |
- end |
|---|
| 294 |
- |
|---|
| 295 |
def test_has_many_dependence_on_account |
|---|
| 296 |
assert_equal 2, Account.find_all.length |
|---|
| 297 |
companies(:first_firm).destroy |
|---|
| 298 |
@@ -317,12 +306,18 @@ |
|---|
| 299 |
|
|---|
| 300 |
def test_has_one |
|---|
| 301 |
assert companies(:first_firm).account?(Account.find(1)) |
|---|
| 302 |
- assert companies(:first_firm).has_account?, "37signals should have an account" |
|---|
| 303 |
- assert Account.find(1).firm?(companies(:first_firm)), "37signals account should be able to backtrack" |
|---|
| 304 |
- assert Account.find(1).has_firm?, "37signals account should be able to backtrack" |
|---|
| 305 |
+ assert_equal(Account.find(1).credit_limit, |
|---|
| 306 |
+ companies(:first_firm).account.credit_limit) |
|---|
| 307 |
+ assert(companies(:first_firm).has_account?, |
|---|
| 308 |
+ "37signals should have an account") |
|---|
| 309 |
+ assert(Account.find(1).firm?(companies(:first_firm)), |
|---|
| 310 |
+ "37signals account should be able to backtrack") |
|---|
| 311 |
+ assert(Account.find(1).has_firm?, |
|---|
| 312 |
+ "37signals account should be able to backtrack") |
|---|
| 313 |
|
|---|
| 314 |
assert !Account.find(2).has_firm?, "Unknown isn't linked" |
|---|
| 315 |
- assert !Account.find(2).firm?(companies(:first_firm)), "Unknown isn't linked" |
|---|
| 316 |
+ assert(!Account.find(2).firm?(companies(:first_firm)), |
|---|
| 317 |
+ "Unknown isn't linked") |
|---|
| 318 |
end |
|---|
| 319 |
|
|---|
| 320 |
def test_has_one_build |
|---|
| 321 |
Index: activerecord/test/associations_test.rb |
|---|
| 322 |
=================================================================== |
|---|
| 323 |
--- activerecord/test/associations_test.rb (revision 1873) |
|---|
| 324 |
+++ activerecord/test/associations_test.rb (working copy) |
|---|
| 325 |
@@ -138,15 +138,6 @@ |
|---|
| 326 |
assert_equal account, firm.account |
|---|
| 327 |
end |
|---|
| 328 |
|
|---|
| 329 |
- def test_failing_build_association |
|---|
| 330 |
- firm = Firm.new("name" => "GlobalMegaCorp") |
|---|
| 331 |
- firm.save |
|---|
| 332 |
- |
|---|
| 333 |
- account = firm.build_account |
|---|
| 334 |
- assert !account.save |
|---|
| 335 |
- assert_equal "can't be empty", account.errors.on("credit_limit") |
|---|
| 336 |
- end |
|---|
| 337 |
- |
|---|
| 338 |
def test_create_association |
|---|
| 339 |
firm = Firm.new("name" => "GlobalMegaCorp") |
|---|
| 340 |
firm.save |
|---|
| 341 |
Index: activerecord/test/base_test.rb |
|---|
| 342 |
=================================================================== |
|---|
| 343 |
--- activerecord/test/base_test.rb (revision 1873) |
|---|
| 344 |
+++ activerecord/test/base_test.rb (working copy) |
|---|
| 345 |
@@ -685,7 +685,7 @@ |
|---|
| 346 |
def test_auto_id |
|---|
| 347 |
auto = AutoId.new |
|---|
| 348 |
auto.save |
|---|
| 349 |
- assert (auto.id > 0) |
|---|
| 350 |
+ assert(auto.id > 0) |
|---|
| 351 |
end |
|---|
| 352 |
|
|---|
| 353 |
def quote_column_name(name) |
|---|
| 354 |
@@ -780,7 +780,7 @@ |
|---|
| 355 |
assert_equal 1, topics(:first, :reload).replies_count |
|---|
| 356 |
|
|---|
| 357 |
topics(:first).decrement(:replies_count).decrement!(:replies_count) |
|---|
| 358 |
- assert_equal -1, topics(:first, :reload).replies_count |
|---|
| 359 |
+ assert_equal(-1, topics(:first, :reload).replies_count) |
|---|
| 360 |
end |
|---|
| 361 |
|
|---|
| 362 |
def test_toggle_attribute |
|---|
| 363 |
Index: activerecord/test/deprecated_finder_test.rb |
|---|
| 364 |
=================================================================== |
|---|
| 365 |
--- activerecord/test/deprecated_finder_test.rb (revision 1873) |
|---|
| 366 |
+++ activerecord/test/deprecated_finder_test.rb (working copy) |
|---|
| 367 |
@@ -4,16 +4,9 @@ |
|---|
| 368 |
require 'fixtures/entrant' |
|---|
| 369 |
require 'fixtures/developer' |
|---|
| 370 |
|
|---|
| 371 |
-class FinderTest < Test::Unit::TestCase |
|---|
| 372 |
+class DeprecatedFinderTest < Test::Unit::TestCase |
|---|
| 373 |
fixtures :companies, :topics, :entrants, :developers |
|---|
| 374 |
|
|---|
| 375 |
- def test_find_all_with_limit |
|---|
| 376 |
- entrants = Entrant.find_all nil, "id ASC", 2 |
|---|
| 377 |
- |
|---|
| 378 |
- assert_equal(2, entrants.size) |
|---|
| 379 |
- assert_equal(entrants(:first).name, entrants.first.name) |
|---|
| 380 |
- end |
|---|
| 381 |
- |
|---|
| 382 |
def test_find_all_with_prepared_limit_and_offset |
|---|
| 383 |
if ActiveRecord::ConnectionAdapters.const_defined? :OracleAdapter |
|---|
| 384 |
if ActiveRecord::Base.connection.instance_of?(ActiveRecord::ConnectionAdapters::OracleAdapter) |
|---|
| 385 |
@@ -101,6 +94,11 @@ |
|---|
| 386 |
end |
|---|
| 387 |
|
|---|
| 388 |
def test_find_all_with_limit |
|---|
| 389 |
+ entrants = Entrant.find_all nil, "id ASC", 2 |
|---|
| 390 |
+ |
|---|
| 391 |
+ assert_equal(2, entrants.size) |
|---|
| 392 |
+ assert_equal(entrants(:first).name, entrants.first.name) |
|---|
| 393 |
+ |
|---|
| 394 |
first_five_developers = Developer.find_all nil, 'id ASC', 5 |
|---|
| 395 |
assert_equal 5, first_five_developers.length |
|---|
| 396 |
assert_equal 'David', first_five_developers.first.name |
|---|
| 397 |
Index: activerecord/test/finder_test.rb |
|---|
| 398 |
=================================================================== |
|---|
| 399 |
--- activerecord/test/finder_test.rb (revision 1873) |
|---|
| 400 |
+++ activerecord/test/finder_test.rb (working copy) |
|---|
| 401 |
@@ -12,7 +12,7 @@ |
|---|
| 402 |
end |
|---|
| 403 |
|
|---|
| 404 |
def test_exists |
|---|
| 405 |
- assert (Topic.exists?(1)) |
|---|
| 406 |
+ assert Topic.exists?(1) |
|---|
| 407 |
assert !(Topic.exists?(45)) |
|---|
| 408 |
assert !(Topic.exists?("foo")) |
|---|
| 409 |
assert !(Topic.exists?([1,2])) |
|---|
| 410 |
@@ -38,13 +38,6 @@ |
|---|
| 411 |
} |
|---|
| 412 |
end |
|---|
| 413 |
|
|---|
| 414 |
- def test_find_all_with_limit |
|---|
| 415 |
- entrants = Entrant.find(:all, :order => "id ASC", :limit => 2) |
|---|
| 416 |
- |
|---|
| 417 |
- assert_equal(2, entrants.size) |
|---|
| 418 |
- assert_equal(entrants(:first).name, entrants.first.name) |
|---|
| 419 |
- end |
|---|
| 420 |
- |
|---|
| 421 |
def test_find_all_with_prepared_limit_and_offset |
|---|
| 422 |
if ActiveRecord::ConnectionAdapters.const_defined? :OracleAdapter |
|---|
| 423 |
if ActiveRecord::Base.connection.instance_of?(ActiveRecord::ConnectionAdapters::OracleAdapter) |
|---|
| 424 |
@@ -276,6 +269,11 @@ |
|---|
| 425 |
end |
|---|
| 426 |
|
|---|
| 427 |
def test_find_all_with_limit |
|---|
| 428 |
+ entrants = Entrant.find(:all, :order => "id ASC", :limit => 2) |
|---|
| 429 |
+ |
|---|
| 430 |
+ assert_equal(2, entrants.size) |
|---|
| 431 |
+ assert_equal(entrants(:first).name, entrants.first.name) |
|---|
| 432 |
+ |
|---|
| 433 |
first_five_developers = Developer.find :all, :order => 'id ASC', :limit => 5 |
|---|
| 434 |
assert_equal 5, first_five_developers.length |
|---|
| 435 |
assert_equal 'David', first_five_developers.first.name |
|---|
| 436 |
Index: activerecord/Rakefile |
|---|
| 437 |
=================================================================== |
|---|
| 438 |
--- activerecord/Rakefile (revision 1873) |
|---|
| 439 |
+++ activerecord/Rakefile (working copy) |
|---|
| 440 |
@@ -30,12 +30,14 @@ |
|---|
| 441 |
t.libs << "test" << "test/connections/native_mysql" |
|---|
| 442 |
t.pattern = 'test/*_test{,_mysql}.rb' |
|---|
| 443 |
t.verbose = true |
|---|
| 444 |
+ t.warning = true |
|---|
| 445 |
} |
|---|
| 446 |
|
|---|
| 447 |
Rake::TestTask.new("test_mysql_ruby") { |t| |
|---|
| 448 |
t.libs << "test" << "test/connections/native_mysql" |
|---|
| 449 |
t.pattern = 'test/*_test{,_mysql}.rb' |
|---|
| 450 |
t.verbose = true |
|---|
| 451 |
+ t.warning = true |
|---|
| 452 |
} |
|---|
| 453 |
|
|---|
| 454 |
for adapter in %w( postgresql sqlite sqlite3 sqlserver sqlserver_odbc db2 oci ) |
|---|
| 455 |
@@ -43,6 +45,7 @@ |
|---|
| 456 |
t.libs << "test" << "test/connections/native_#{adapter}" |
|---|
| 457 |
t.pattern = "test/*_test{,_#{adapter}}.rb" |
|---|
| 458 |
t.verbose = true |
|---|
| 459 |
+ t.warning = true |
|---|
| 460 |
} |
|---|
| 461 |
end |
|---|
| 462 |
|
|---|
| 463 |
Index: activerecord/lib/active_record/validations.rb |
|---|
| 464 |
=================================================================== |
|---|
| 465 |
--- activerecord/lib/active_record/validations.rb (revision 1873) |
|---|
| 466 |
+++ activerecord/lib/active_record/validations.rb (working copy) |
|---|
| 467 |
@@ -310,7 +310,7 @@ |
|---|
| 468 |
configuration = { :message => ActiveRecord::Errors.default_error_messages[:confirmation], :on => :save } |
|---|
| 469 |
configuration.update(attr_names.pop) if attr_names.last.is_a?(Hash) |
|---|
| 470 |
|
|---|
| 471 |
- attr_accessor *(attr_names.map { |n| "#{n}_confirmation" }) |
|---|
| 472 |
+ attr_accessor(*(attr_names.map { |n| "#{n}_confirmation" })) |
|---|
| 473 |
|
|---|
| 474 |
validates_each(attr_names, configuration) do |record, attr_name, value| |
|---|
| 475 |
record.errors.add(attr_name, configuration[:message]) unless record.send("#{attr_name}_confirmation").nil? or value == record.send("#{attr_name}_confirmation") |
|---|
| 476 |
@@ -339,7 +339,7 @@ |
|---|
| 477 |
configuration = { :message => ActiveRecord::Errors.default_error_messages[:accepted], :on => :save, :allow_nil => true, :accept => "1" } |
|---|
| 478 |
configuration.update(attr_names.pop) if attr_names.last.is_a?(Hash) |
|---|
| 479 |
|
|---|
| 480 |
- attr_accessor *attr_names |
|---|
| 481 |
+ attr_accessor(*attr_names) |
|---|
| 482 |
|
|---|
| 483 |
validates_each(attr_names,configuration) do |record, attr_name, value| |
|---|
| 484 |
record.errors.add(attr_name, configuration[:message]) unless value == configuration[:accept] |
|---|
| 485 |
Index: activerecord/lib/active_record/connection_adapters/abstract_adapter.rb |
|---|
| 486 |
=================================================================== |
|---|
| 487 |
--- activerecord/lib/active_record/connection_adapters/abstract_adapter.rb (revision 1873) |
|---|
| 488 |
+++ activerecord/lib/active_record/connection_adapters/abstract_adapter.rb (working copy) |
|---|
| 489 |
@@ -410,10 +410,6 @@ |
|---|
| 490 |
raise NotImplementedError, "change_column_default is not implemented" |
|---|
| 491 |
end |
|---|
| 492 |
|
|---|
| 493 |
- def supports_migrations? |
|---|
| 494 |
- false |
|---|
| 495 |
- end |
|---|
| 496 |
- |
|---|
| 497 |
def rename_column(table_name, column_name, new_column_name) |
|---|
| 498 |
raise NotImplementedError, "rename_column is not implemented" |
|---|
| 499 |
end |
|---|
| 500 |
Index: activerecord/lib/active_record/connection_adapters/oci_adapter.rb |
|---|
| 501 |
=================================================================== |
|---|
| 502 |
--- activerecord/lib/active_record/connection_adapters/oci_adapter.rb (revision 1873) |
|---|
| 503 |
+++ activerecord/lib/active_record/connection_adapters/oci_adapter.rb (working copy) |
|---|
| 504 |
@@ -55,7 +55,7 @@ |
|---|
| 505 |
|
|---|
| 506 |
def cast_to_date_or_time(value) |
|---|
| 507 |
return value if value.is_a? Date |
|---|
| 508 |
- guess_date_or_time (value.is_a? Time) ? value : cast_to_time(value) |
|---|
| 509 |
+ guess_date_or_time value.is_a?(Time) ? value : cast_to_time(value) |
|---|
| 510 |
end |
|---|
| 511 |
|
|---|
| 512 |
def cast_to_time(value) |
|---|
| 513 |
Index: activerecord/lib/active_record/query_cache.rb |
|---|
| 514 |
=================================================================== |
|---|
| 515 |
--- activerecord/lib/active_record/query_cache.rb (revision 1873) |
|---|
| 516 |
+++ activerecord/lib/active_record/query_cache.rb (working copy) |
|---|
| 517 |
@@ -42,9 +42,11 @@ |
|---|
| 518 |
end |
|---|
| 519 |
end |
|---|
| 520 |
|
|---|
| 521 |
- class Base |
|---|
| 522 |
+ class << Base |
|---|
| 523 |
+ alias old_connection= connection= |
|---|
| 524 |
+ |
|---|
| 525 |
# Set the connection for the class with caching on |
|---|
| 526 |
- def self.connection=(spec) |
|---|
| 527 |
+ def connection=(spec) |
|---|
| 528 |
raise ConnectionNotEstablished unless spec |
|---|
| 529 |
|
|---|
| 530 |
conn = spec.config[:query_cache] ? |
|---|
| 531 |
Index: activerecord/lib/active_record/fixtures.rb |
|---|
| 532 |
=================================================================== |
|---|
| 533 |
--- activerecord/lib/active_record/fixtures.rb (revision 1873) |
|---|
| 534 |
+++ activerecord/lib/active_record/fixtures.rb (working copy) |
|---|
| 535 |
@@ -483,7 +483,8 @@ |
|---|
| 536 |
instantiate_fixtures if use_instantiated_fixtures |
|---|
| 537 |
end |
|---|
| 538 |
|
|---|
| 539 |
- alias_method :setup, :setup_with_fixtures |
|---|
| 540 |
+ alias old_setup setup |
|---|
| 541 |
+ alias setup setup_with_fixtures |
|---|
| 542 |
|
|---|
| 543 |
def teardown_with_fixtures |
|---|
| 544 |
# Rollback changes. |
|---|
| 545 |
@@ -493,7 +494,8 @@ |
|---|
| 546 |
end |
|---|
| 547 |
end |
|---|
| 548 |
|
|---|
| 549 |
- alias_method :teardown, :teardown_with_fixtures |
|---|
| 550 |
+ alias old_teardown teardown |
|---|
| 551 |
+ alias teardown teardown_with_fixtures |
|---|
| 552 |
|
|---|
| 553 |
def self.method_added(method) |
|---|
| 554 |
case method.to_s |
|---|
| 555 |
Index: actionpack/Rakefile |
|---|
| 556 |
=================================================================== |
|---|
| 557 |
--- actionpack/Rakefile (revision 1873) |
|---|
| 558 |
+++ actionpack/Rakefile (working copy) |
|---|
| 559 |
@@ -28,6 +28,7 @@ |
|---|
| 560 |
t.test_files=Dir.glob( "test/c*/*_test.rb" ) + Dir.glob( "test/[ft]*/*_test.rb" ) |
|---|
| 561 |
# t.pattern = 'test/*/*_test.rb' |
|---|
| 562 |
t.verbose = true |
|---|
| 563 |
+ t.warning = true |
|---|
| 564 |
} |
|---|
| 565 |
|
|---|
| 566 |
|
|---|
| 567 |
@@ -239,4 +240,4 @@ |
|---|
| 568 |
first_file = false |
|---|
| 569 |
end |
|---|
| 570 |
end |
|---|
| 571 |
-end |
|---|
| 572 |
\ No newline at end of file |
|---|
| 573 |
+end |
|---|
| 574 |
Index: actionpack/lib/action_controller/request.rb |
|---|
| 575 |
=================================================================== |
|---|
| 576 |
--- actionpack/lib/action_controller/request.rb (revision 1873) |
|---|
| 577 |
+++ actionpack/lib/action_controller/request.rb (working copy) |
|---|
| 578 |
@@ -1,7 +1,7 @@ |
|---|
| 579 |
module ActionController |
|---|
| 580 |
# These methods are available in both the production and test Request objects. |
|---|
| 581 |
class AbstractRequest |
|---|
| 582 |
- cattr_accessor :relative_url_root |
|---|
| 583 |
+ cattr_writer :relative_url_root |
|---|
| 584 |
|
|---|
| 585 |
# Returns both GET and POST parameters in a single hash. |
|---|
| 586 |
def parameters |
|---|
| 587 |
Index: actionpack/lib/action_controller/test_process.rb |
|---|
| 588 |
=================================================================== |
|---|
| 589 |
--- actionpack/lib/action_controller/test_process.rb (revision 1873) |
|---|
| 590 |
+++ actionpack/lib/action_controller/test_process.rb (working copy) |
|---|
| 591 |
@@ -15,13 +15,15 @@ |
|---|
| 592 |
|
|---|
| 593 |
class TestRequest < AbstractRequest #:nodoc: |
|---|
| 594 |
attr_accessor :cookies |
|---|
| 595 |
- attr_accessor :query_parameters, :request_parameters, :path, :session, :env |
|---|
| 596 |
+ attr_accessor :query_parameters, :request_parameters, :session, :env |
|---|
| 597 |
attr_accessor :host |
|---|
| 598 |
+ attr_writer :path |
|---|
| 599 |
|
|---|
| 600 |
def initialize(query_parameters = nil, request_parameters = nil, session = nil) |
|---|
| 601 |
@query_parameters = query_parameters || {} |
|---|
| 602 |
@request_parameters = request_parameters || {} |
|---|
| 603 |
@session = session || TestSession.new |
|---|
| 604 |
+ @path = nil |
|---|
| 605 |
|
|---|
| 606 |
initialize_containers |
|---|
| 607 |
initialize_default_values |
|---|
| 608 |
Index: actionpack/lib/action_controller/cgi_ext/raw_post_data_fix.rb |
|---|
| 609 |
=================================================================== |
|---|
| 610 |
--- actionpack/lib/action_controller/cgi_ext/raw_post_data_fix.rb (revision 1873) |
|---|
| 611 |
+++ actionpack/lib/action_controller/cgi_ext/raw_post_data_fix.rb (working copy) |
|---|
| 612 |
@@ -1,6 +1,7 @@ |
|---|
| 613 |
class CGI #:nodoc: |
|---|
| 614 |
# Add @request.env['RAW_POST_DATA'] for the vegans. |
|---|
| 615 |
module QueryExtension |
|---|
| 616 |
+ alias old_initialize_query initialize_query |
|---|
| 617 |
# Initialize the data from the query. |
|---|
| 618 |
# |
|---|
| 619 |
# Handles multipart forms (in particular, forms that involve file uploads). |
|---|
| 620 |
Index: actionpack/lib/action_view/base.rb |
|---|
| 621 |
=================================================================== |
|---|
| 622 |
--- actionpack/lib/action_view/base.rb (revision 1873) |
|---|
| 623 |
+++ actionpack/lib/action_view/base.rb (working copy) |
|---|
| 624 |
@@ -151,6 +151,7 @@ |
|---|
| 625 |
def initialize(base_path = nil, assigns_for_first_render = {}, controller = nil)#:nodoc: |
|---|
| 626 |
@base_path, @assigns = base_path, assigns_for_first_render |
|---|
| 627 |
@controller = controller |
|---|
| 628 |
+ @first_render = nil |
|---|
| 629 |
end |
|---|
| 630 |
|
|---|
| 631 |
# Renders the template present at <tt>template_path</tt>. If <tt>use_full_path</tt> is set to true, |
|---|