Commit Graph

8195 Commits

Author SHA1 Message Date
madlep
8e50f0f96e Fix image_tag behavior on windows. [#1085 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-10-06 23:43:41 +01:00
Manfred Stienstra
efb9ef65cc Fix a typo in ActiveSupport::Multibyte::NORMALIZATION_FORMS. [#1179 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-10-06 19:04:45 +01:00
Jeremy Kemper
5bc91b0592 Mark utf-8 source encoding 2008-10-06 10:56:56 -07:00
Eugene Pimenov
8603813ac6 Fix memoize_all for methods with punctuation [#1175 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2008-10-05 17:25:58 -05:00
Chris Cherry
1c75b4fd42 Fix deprecated ActionController::Base.relative_url_root call in mongrel command
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2008-10-05 17:25:57 -05:00
Pratik Naik
a2932784bb Merge docrails 2008-10-05 22:16:26 +01:00
Matthew Moore
4df45d8609 ActiveResource can load array of strings, like serialize :bar, Array
Signed-off-by: rick <technoweenie@gmail.com>
[#1055 state:resolved]
2008-10-05 10:29:13 -07:00
Matt Jones
2bf58aa782 Fix a number of errors in the config.gem mechanism.
* Rails::GemDependency was missing definitions for hash and eql?, causing Array#uniq to not work.

* If several versions of a gem are unpacked in vendor, now chooses the highest if no version is specified.

* streamlined add_load_path. Now sets up Rubygems correctly to allow 'gem' to find frozen gems, with
  gems frozen to vendor/gems and specifications in vendor/gems/<gem-name>/.specification

* Rails::GemDependency#specification would return a spec for the highest installed version, even for
  frozen gems and/or previously loaded lower versions. See in part ticket #1123.

* removed vendor from default_load_paths - it was causing autoloading to append Gems::Gems::<gem-dir> to
  constant names

* added additional tests for loading frozen gems.

* incorporates the fix from #1107 for vendor rails

* defers to freeze:gems for handling the Rails framework. gems:unpack WILL NOT place a copy of Rails
  in vendor/gems. Should close #1123 completely.

* incorporates, via using the gem loader for frozen gems, fixes corresponding to #227, #324, #362, #527, and #742.

* gem plugins now work the same whether frozen or not. Correctness of the behavior is a matter for another ticket...

Signed-off-by: rick <technoweenie@gmail.com>
2008-10-05 10:16:17 -07:00
Pratik Naik
4f53db0096 Move controller ivar copying to a separate method 2008-10-05 14:01:00 +01:00
Pratik Naik
259a7a844b Add tests for ActiveSupport::Rescuable. Use ActiveSupport::Rescuable in ActionController::Base. 2008-10-04 22:13:50 +01:00
Norbert Crombach
964dfc1557 First draft of ActiveSupport::Rescuable
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-10-04 20:28:08 +01:00
Pratik Naik
9599948fbc Ensure Model.sum and Model.avg typecast appropriately. [#1066 state:resolved]
Model.sum delegates typecasting to the column being summed. If that's not feasible, returns a string.
Model.avg always returns big decimal.
2008-10-04 20:13:44 +01:00
Michael Koziarski
1dfebd4f0d 1.8 compatibility for random_number method on SecureRandom.
1.9 has its own version.
2008-10-04 21:11:30 +02:00
Michael Koziarski
923eb9569c Fix mismatched assertions. 2008-10-04 21:11:30 +02:00
Pratik Naik
5e3517ea7b Ensure rescue_from handlers are respected inside tests. [#835 state:resolved]
Note : If you're not using rescue_from, you should overrider rescue_action_without_handler() method
and not rescue_action(). Afterwards, you can set request.remote_addr to a non "0.0.0.0" value for testing the
overridden behavior.
2008-10-04 18:43:46 +01:00
Pratik Naik
4918e6de98 Remove HasManyAssociationStrategy and move the logic to ActiveRecord::Reflection::ThroughReflection. 2008-10-04 17:49:39 +01:00
Pratik Naik
25ca21ae21 Introduce ActiveRecord::Reflection::ThroughReflection to simplify hm:t reflection logic 2008-10-04 17:49:39 +01:00
Zach Dennis
95e1cf4812 Fix has_many :through when the source is a belongs_to association. [#323 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-10-04 17:49:39 +01:00
Lawrence Pit
7659fb6a2b Try reloading model on class mismatch [#229 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-10-04 17:49:38 +01:00
Aliaksey Kandratsenka
b437a7d34e Return processing lock to dispatcher, the finer grained lock was incompatible with the reloading in development mode.
This commit also adds ActionController::Dispatcher#dispatch_unlocking -- non-locking version of dispatch.
It's named anologously to POSIX {getc,getchar,...}_unlocked functions.

Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#1170 state:committed]
2008-10-04 18:25:08 +02:00
Aliaksey Kandratsenka
f550c86257 Fix performance bug in AttibuteMethods#respond_to? in handling of private methods
We have hit dramatic increase in tests time after upgrading rails.
Profiling revealed this particular place. After this fix our test times returned
back to norm.

Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#1173 state:committed]
2008-10-04 17:48:13 +02:00
Aliaksey Kandratsenka
6080b73b1c call clear_active_connections! in :after_dispatch to give pooled connections back
This fixes connection pool exhaustion for web servers which create new thread per connection (e.g. Webrick).

integration.rb changes are required to keep test transaction active for several requests.

Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#1171 state:committed]
2008-10-04 17:48:13 +02:00
Aliaksey Kandratsenka
834361145a made ConnectionPool#checkout more robust by trying to loot dead threads when pool is empty
Signed-off-by: Michael Koziarski <michael@koziarski.com>

[#1169 state:committed]
2008-10-04 17:48:13 +02:00
Aliaksey Kandratsenka
21eb18a70c Fix race in ConnectionPool#checkout
After releasing monitor some connection(s) may appear in pool before monitor is re-aquired.
When this happens we'll wait for connection which is already available.

Signed-off-by: Michael Koziarski <michael@koziarski.com>
2008-10-04 17:48:13 +02:00
Aliaksey Kandratsenka
4cb3d27443 don't quote decimal values for mysql. It doesn't make sense and breaks in newer versions of mysql
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#1168 state:committed]
2008-10-04 17:48:13 +02:00
madlep
2def5b6314 Fixed load path for actionmailer and activesupport tests to always load from local lib files.
[#983 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2008-10-04 07:57:18 -07:00
Antonio Cangiano
f0e90740d0 Add IMB DB support to Rails application generator. [#1136 state:resolved]
Usage : rails app_name -d ibm_db

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2008-10-04 13:54:27 +01:00
Luca Guidi
1bc267d216 Make sure recreate MySQL test database with the proper encoding and collation [#1165 state:resolved]
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#1165 state:committed]
2008-10-03 22:08:55 +02:00
Michael Koziarski
7553a23c0a Remove AS for oracle compatibility 2008-10-03 21:35:01 +02:00
madlep
00e2ba76b2 added nicer failure reporting to #assert_difference to tell you the expression that failed rather than just the expected and actual values
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#1161 state:committed]
2008-10-03 21:31:56 +02:00
Nick Sieger
395369bc2b Provide alternate implementation of Object#subclasses_of for JRuby
Signed-off-by: Michael Koziarski <michael@koziarski.com>

[#1144 state:committed]
2008-10-03 21:28:47 +02:00
Eloy Duran
8d337e9ec2 Dynamic finders should use the ActiveRecord::Base::find method instead of ::find_initial, :find_last, and ::find_all.
This is so when people override ActiveRecord::Base::find, the new ::find method will also be invoked by the dynamic finders.
Associations for instance do go through ::find, so this makes it more consistent.
Also removed the unnecessary deprecation silence blocks.

Signed-off-by: Michael Koziarski <michael@koziarski.com>

[#1162 state:committed]
2008-10-03 21:28:11 +02:00
David Masover
e69b506abd Call controller_path instance method so it can be easily overridden [#1141 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2008-09-30 12:07:21 -05:00
Michael Koziarski
0eefa7058a Fix etag! and last_modified! to work as advertised.
Add tests too.
2008-09-30 17:00:38 +02:00
Michael Koziarski
0b46503254 Remove unneeded interning. 2008-09-30 11:34:05 +02:00
Will Bryant
35d731ef0a fix eager loading's :condition sanitizing expanding against the wrong table
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2008-09-29 17:49:44 +02:00
Will Bryant
8233f8314b wrote a test showing eager loading's misbehavior (sanitizing against the wrong table) when the association has a :conditions hash
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2008-09-29 17:49:44 +02:00
Andrew Kaspick
8c105ee0c8 Add options to field_set_tag
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#1116 state:committed]
2008-09-29 17:47:29 +02:00
Joshua Peek
28bf2fa038 Protect body ivar from being clobbered by the mailer template assigns 2008-09-28 12:31:45 -05:00
Tarmo Tänav
ea609b265f Ignore all exceptions for validates_acceptance_of columns fetch so it can run even without a database connection
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2008-09-26 20:09:39 +02:00
Adam Milligan
4d9a7ab5f5 Changed ActiveRecord attributes to respect access control.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#1084 state:committed]
2008-09-24 19:40:07 +02:00
Michael Koziarski
a78ec93036 Partially revert 185fe2e9cce737d69d3b47a656f3651ce152c0c1
We shouldn't quote the unpack command's requirement as it's passed through GemRunner which takes care of it for us.
2008-09-24 18:46:45 +02:00
Michael Koziarski
025736de8e Use ActiveSupport::SecureRandom instead of the strange fallback code. 2008-09-24 16:24:02 +02:00
Hongli Lai (Phusion)
72b772ae9b Refactor configure_dependency_for_has_many to use a few more methods.
Add an additional conditions option to make it slightly easier for certain plugins.

Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#1087 state:committed]
2008-09-24 13:27:39 +02:00
Pivotal Labs
487758b3b8 Allowed passing arrays-of-strings to :join everywhere. Merge duplicate join strings to avoid table aliasing problems.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#1077 state:committed]
2008-09-24 13:26:06 +02:00
Hongli Lai (Phusion)
70b8ea4fa6 Make AssociationCollection start transactions in the correct database.
AssociationCollection now starts transactions by calling
AssociationCollection#transaction instead of @owner.transaction or
@reflection.klass.transaction.

Signed-off-by: Michael Koziarski <michael@koziarski.com>

[#1081 state:committed]
2008-09-23 20:32:01 +02:00
adam
2e75bd0808 slice now returns indifferent hash if called on one
Signed-off-by: Michael Koziarski <michael@koziarski.com>

[#1096 state:committed]
2008-09-23 14:04:20 +02:00
adam
c452e49e76 Adds failed test case for slicing hash with indifferent access with symbol keys
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2008-09-23 14:04:13 +02:00
Adam Cigánek
a4f2ba8fb3 Modified ActiveSupport::Inflector#parameterize with code from slugalizer (http://github.com/henrik/slugalizer)
Handles trailing and leading slashes, and squashes repeated separators into a single character.

Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#1034 state:committed]
2008-09-23 08:08:21 +02:00
Michael Koziarski
961e2b8610 Changelog entry for manfred's multibyte changes 2008-09-22 21:52:21 +02:00