Skip to content
This repository
  • 149 commits
  • 251 files changed
  • 60 contributors
Mar 24, 2009
Joshua Peek josh just kill brittle test c919127
Peter Marklund Reset request_parameters in TestRequest#recycle! to avoid multiple po…
…sts clobbering each other [#2271 state:resolved]

Signed-off-by: Joshua Peek <>
David Dollar ddollar Updates tests to cause the tests for the Request class not to proxy t…
…hrough a fake TestRequest object [#2278 state:resolved]

Signed-off-by: Joshua Peek <>
thedarkone Simplify handling of absolute path templates. [#2276 state:resolved]
Signed-off-by: Joshua Peek <>
thedarkone Fix template extension parsing. [#2315 state:resolved] [#2284 state:r…

Signed-off-by: Joshua Peek <>
Ryan Angilly ryana adding session_options initialization and test [#2303 state:resolved]
Signed-off-by: Joshua Peek <>
Apr 07, 2009
kenny yairgo added tests for session options being defaulted correctly to rack def…
…aults [#2403 state:resolved]

Signed-off-by: Joshua Peek <>
Doug McInnes dmcinnes Fix for TestResponse.cookies returning cookies unescaped [#1867 state…

Signed-off-by: David Heinemeier Hansson <>
Apr 16, 2009
David Heinemeier Hansson dhh Added ActiveRecord::Base#touch to update the updated_at/on attributes…
… with the current time [DHH]
David Heinemeier Hansson dhh Added :touch option to belongs_to associations that will touch the pa…
…rent record when the current record is saved or destroyed [DHH]
Apr 17, 2009
Jeremy Kemper jeremy Clearer String#first and #last edge cases. Fix that foo.first(0) == i…
…nstead of foo.
Mislav Marohnić mislav Improve rewindable input test coverage so tests fail when you remove …
…the middleware

Signed-off-by: Joshua Peek <>
Mislav Marohnić mislav Always buffer rack.input if it is not rewindable
Signed-off-by: Joshua Peek <>
Apr 20, 2009
Pratik lifo Ensure JoinAssociation uses aliased table name when multiple associat…
…ions have hash conditions on the same table
Apr 21, 2009
Pratik lifo Ensure :dependent => :delete_all works for association with hash cond…
Max Lapshin maxlapshin Support multiple schemas in table names for postgresql [#390 state:re…

Signed-off-by: Pratik Naik <>
Max Lapshin maxlapshin Fixed wrong quoting of index names in postgres [#2402 state:resolved]
Signed-off-by: Tarmo Tänav <>
Scott Woods woods Quote table names when casting to regclass so that capitalized tables…
… are supported. [#2418 state:resolved]

Signed-off-by: Tarmo Tänav <>
Max Lapshin maxlapshin Fixed dumping from postgresql columns in index in wrong order. [#2515

Signed-off-by: Tarmo Tänav <>
Pratik lifo Fix tests for sqlite3 3.6.xx 3267097
Pratik lifo Specify :group with the table name for it to work on sqlite3 5bbd097
Pratik lifo Change table to prevent copying indexes on sqlite2 09a976a
Apr 22, 2009
Jeremy Kemper jeremy Merge branch '2-3-stable' of into 2-3-stable 617d7eb
Apr 25, 2009
Joshua Peek josh Remove pending rack specifications until they are official 2d9b457
Joshua Peek josh Remove vendored version of Rack 16f36b6
Joshua Peek josh Remove RewindableInput middleware since all input MUST be rewindable …
…according to a recent change in the Rack 1.0 SPEC
Yehuda Katz wycats Updated 2-3-stable to Rack 1.0 cb9a1f1
Apr 26, 2009
Hongli Lai FooBarWidget Remove reference to Rack::RewindableInput, which has been removed a w…
…hile ago.

Signed-off-by: Joshua Peek <>
Hongli Lai FooBarWidget Fix environment variable testing code in failsafe.rb.
Signed-off-by: Joshua Peek <>
Stephen Bannasch stepheneb add JRuby-JDOM backend for XmlMini
Signed-off-by: Jeremy Kemper <>
Apr 28, 2009
David Dollar ddollar Attempt to deal with more cases of gems with native components.
This commit adds a rudimentary check for 'unbuilt' gems, so that we can abort
the application load if there are any gems that have native components that
have not yet been built.

The rake task gems:build has now only builds 'unbuilt' gems as a result.

The rake task gems:build:force has been added to deal with cases of incomplete
builds, or any case where you need to force the build of all of your gems.

Changes the gems:build task to get its gem list by parsing directory entries
in vendor/gems, which sidesteps the chicken/egg issues involved with having a
gem unpacked into vendor/gems without before its native bits are compiled.

[#2266 state:committed]

Signed-off-by: Jeremy Kemper <>
Apr 29, 2009
David Dollar ddollar Additional tests for the gem subsystem
* test_gem_ignores_development_dependencies
  * test_gem_guards_against_duplicate_unpacks
  * test_gem_does_not_unpack_framework_gems

[#2236 state:committed]

Signed-off-by: Jeremy Kemper <>
Apr 30, 2009
Jeremy Kemper jeremy Fix render :json => nil [#2589 state:resolved] 7c4b325
John F. Douthat johndouthat Fix action-cached exception responses.
Methods raising ActiveRecord::RecordNotFound were returning 404 on first request and 200 OK with blank body on subsequent requests.

[#2533 state:committed]

Signed-off-by: Jeremy Kemper <>
Jeremy Kemper jeremy Missed commit for 7c4b325 a5ed7ee
May 01, 2009
Alexander Podgorbunsky shurikp Default scope :order should be overridden by named scopes.
[#2346 state:committed]

Signed-off-by: Jeremy Kemper <>
Ruy Asan rubyruy Fixed bug with polymorphic has_one :as pointing to an STI record
[#2594 state:committed]

Signed-off-by: Jeremy Kemper <>
Ruy Asan rubyruy Added routing test for irregular ID requirements and custom member ac…

[#2595 state:committed]

Signed-off-by: Jeremy Kemper <>
May 04, 2009
codebrulee Remove stray underscore from the hash conversion methods which broke …
…backwards compatibility with Hash.from_xml

Also add an all-caps test to prevent future regressions
Tim Connor timocratic fix problems with requires in metal choking under development reloadi…
…ng [#2579 state:resolved]

Signed-off-by: Joshua Peek <>
Greg Hurrell wincent Extract ActionController::Caching::Sweeper into separate file [#1977

Signed-off-by: Joshua Peek <>
Joshua Peek josh Deprecate assert_redirect_to's partial hash matching. This will be fu…
…lly removed in 3.0.
May 08, 2009
Joshua Peek josh Don't stream each line of the body, just send the whole thing e61cceb
May 09, 2009
Joshua Peek josh Fix syntax error from 5ac05f1 4051dd3
May 10, 2009
Ken Collins metaskills ActiveSupport::OrderedHash#to_a method returns an ordered set of arra…
…ys. Matches ruby1.9's Hash#to_a.

Signed-off-by: Michael Koziarski <>
[#2629 state:committed]
John Small JohnSmall Add configuration options for :dasherize and :camelize calls to Hash#…

People using ActiveResource & REST to integrate with other systems need to be able to control the default dasherize behavior of Hash.to_xml.
Currently there is no test for a default value, but existing code asssumes it's true. This patch adds tests for the default value and adds
mattr_accessor to ActiveSupport for :dasherize_xml and :camelize_xml. These module attributes set the defaults for :dasherize and :camelize in
rename_keys inside Hash#to_xml. The tests have been changed to separate out the testing of the parameter options for :camelize
and :dasherize so that we only test one thing at a time. We also test default values for :camelize_xml and :dasherize_xml.

The module attribute dasherize_xml is set to true in this patch to maintain existing code. But at some point in the future it should be set to
false because Hash#to_xml probably should not set underscores to dashes by default.

Changed documentation on ActiveResource#to_xml to correctly describe the behaviour of Hash#to_xml. The previous documentation said that
the default for :dasherize was false, in fact it was and still is true, but we now have a way to change the default. I've also added
documentation for the :camelize option.

Signed-off-by: Michael Koziarski <>
Anthony Crumley anthonycrumley Fixed eager load error on find with include => [:table_name] and hash…
… conditions like {:table_name => {:column => 'value'}}

Signed-off-by: Michael Koziarski <>
May 11, 2009
Douglas F Shearer dougal ActiveSupport::OrderedHash[1,2,3,4] creates an OrderedHash instead of…
… a Hash.

[#2615 state:committed]

Signed-off-by: Jeremy Kemper <>
Jeremy Kemper jeremy Revert "Fixed bug with polymorphic has_one :as pointing to an STI rec…

[#2594 state:open]

This reverts commit 93c5578.
May 14, 2009
Peter Marklund Changed ActiveRecord::Base#exists? to invoke find_initial so that it …
…is compatible with, and doesn't lose, :include scopes (references to eager loaded tables)

Signed-off-by: Michael Koziarski <>
[#2543 state:committed]
Joshua Peek josh Sweeper does not belong in Sweeping module f7cb7fc
May 15, 2009
José Valim josevalim Allow strings to be sent as collection to select.
Signed-off-by: Michael Koziarski <>
[#2391 state:committed]
May 16, 2009
Pratik lifo Include guides directory in the rails gem ba92e83
May 17, 2009
Daniel dguettler has_one :through should not create a new association when assigned nil [
#698 state:resolved]

Signed-off-by: Pratik Naik <>
Jacob Kjeldahl Supply valid ruby-prof parameters [#1804 state:resolved]
Signed-off-by: Pratik Naik <>
Paulo Schneider phss Fix typo in the generated routes.rb [#2433 state:resolved]
Signed-off-by: Pratik Naik <>
Mike Breen hardbap Allow assert_template to take a symbol [#2011 state:resolved]
Signed-off-by: Pratik Naik <>
Joshua Peek josh Fix reset_session with ActiveRecord store [#2200 state:resolved] e30016c
Joshua Peek josh Missed a file from the previous commit 43e537b
risk danger olson technoweenie Add pluggable JSON backends with support for the JSON gem.
    Example: ActiveSupport::JSON.backend = "JSONGem"

All internal Rails JSON encoding is now handled by
ActiveSupport::JSON.encode().  Use of #to_json is not recommended, as it
may clash with other libraries that overwrite it.  However, you can
recover Rails specific functionality
if you really want to use #to_json.

    gem 'json'
    ActiveSupport::JSON.backend = "JSONGem"

    class ActiveRecord::Base
      alias to_json rails_to_json
Jeremy Kemper jeremy Only Object to_json alias is needed. Prefer nil options. cc47d3f
Jeremy Kemper jeremy Extract json string escaping 5b80ead
risk danger olson technoweenie load the JSON Backend lazily. 2b5e4f3
May 18, 2009
Pratik lifo Ensure HTTP Digest auth uses appropriate HTTP method [#2490 state:res…
…olved] [Steve Madsen]
Pratik lifo Make sure default_scope#create checks for options[:conditions] [#2181
…state:resolved] [James Le Cuirot]
Luca Guidi Ensure HasManyThroughAssociation#destroy delete orphan records [#2251

Signed-off-by: Pratik Naik <>
Ken Collins metaskills Reimplement Fixtures.identify so that it consistently generates ident…
…ities across ruby versions.

[#2633 state:committed]

Signed-off-by: Jeremy Kemper <>
Joe Van Dyk joevandyk Add ability to get multiple memcached keys at the same time (via MemC…

Signed-off-by: Jeremy Kemper <>
Jeremy Kemper jeremy Fix imprecise float comparison 9fcadcb
May 19, 2009
Bryan Helmkamp brynary Allow MemCacheStore to be initialized with a MemCache object instead …
…of addresses and options
Jeremy Kemper jeremy Mark pending release in changelog instead of edge 2a65772
Bryan Helmkamp brynary Use duck typing to also allow MemCache-like object when initializing …
…a MemCacheStore

Signed-off-by: Jeremy Kemper <>
May 20, 2009
Eloy Durán alloy Ensure the parent record is always saved when the child is invalid. [#…
…2249 state:resolved]

Signed-off-by: Pratik Naik <>
May 25, 2009
Hongli Lai FooBarWidget activesupport/json/encoders fix that to_json should call rails_to_jso…
…n, not just be an alias to the rails_to_json method defined in Object. Fixes #2690

Signed-off-by: Pratik Naik <>
May 27, 2009
Joshua Peek josh Ensure Memcache local cache returns duplicated values [#2302 state:re…
David Calavera calavera ensure initialize_database_middleware doesn't use ActionController if…
… action_controller framework is not enabled [#2680 state:resolved]

Signed-off-by: Joshua Peek <>
Hongli Lai FooBarWidget Make the Failsafe middleware attempt to render 500.html during failsa…
…fe response rendering. Also make the default static failsafe response more friendly, in case 500.html rendering fails. [#2715 state:resolved]

Signed-off-by: Joshua Peek <>
May 28, 2009
Johan Sørensen js The FlashHash and friends causes a lot of needless session storing, w…
…hen we know for a fact that there's no content in the flash. By not storing the empty hash in the session we save a lot of communication with the various session backends, while still keeping the same interface to the flash. [#2703 state:resolved]

Signed-off-by: Joshua Peek <>
Johan Sørensen js Only save the session if we're actually writing to it [#2703 state:re…

Signed-off-by: Joshua Peek <>
May 30, 2009
Joshua Peek josh Revert "Only save the session if we're actually writing to it [#2703

This reverts commit 14edaa1.
Jun 01, 2009
Michael Koziarski NZKoz Revert "Ensure calculations respect scoped :select". Broke .count on …
…a has_many :through association.

This reverts commit 6543426.
Ian Terrell ianterrell added a failing test case for counting has_many :through associations…
… with scopes

Signed-off-by: Michael Koziarski <>
Han Kessels han fix for IE incompatibility of :disable_with in submit_tag
Signed-off-by: Michael Koziarski <>
Michael Koziarski NZKoz name is case sensitive, update tests to reflect that b600bf2
Jun 05, 2009
Tim Connor timocratic Work around a gem dependency edge case that prevents Rails from booti…

If you have a frozen gem with unfrozen dependencies (for instance if the
dependency has native extensions so can't be frozen) you can have a
nightmare upgrade problem, where you cannot rake gems:install, because
rake is broken by a gem loading problem.

If you bump up your frozen gem to a newer version that requires a newer
dependency, everybody else on the team will have rake broken by that
dependency mismatch, since you will have had to specify the dependency
in your config.gems, otherwise nobody will have installed it, since the
parent is frozen. And now the config.gems loading code will kill rake.

[#2609 state:committed]

Signed-off-by: Jeremy Kemper <>
Jun 08, 2009
Jeremy Kemper jeremy Don't rely on Rails.logger 4b4164e
Jeremy Kemper jeremy Revert rails_to_json -> to_json so we don't break compatibility
[#2753 state:resolved]
Jeremy Kemper jeremy JSON: split encoding and coercion a69ee11
Jeremy Kemper jeremy Use to_json instead of rails_to_json 01f820c
Jeremy Kemper jeremy Ruby 1.9: fix json encoding ec10f13
Jeremy Kemper jeremy Integration tests use Rack::Lint on 1.9 also aebd1ba
Jeremy Kemper jeremy Check for to_str instead of String 05abd7c
Jeremy Kemper jeremy Failsafe doesn't return bare String body 91fbdfd
Jeremy Kemper jeremy Ruby 1.9: sqlite escape encoding 91727ae
Jeremy Kemper jeremy Lazier Rakefile requires to avoid needing full rake gem on 1.9 cc5d313
Jeremy Kemper jeremy Add #element and #collection to ModelName f1e75e4
Jeremy Kemper jeremy Simplify json decoder backend lazy load 74f16a5
Jeremy Kemper jeremy Prefer JSON.encode(value) to value.to_json 756e82d
Jeremy Kemper jeremy Qualify constant references in BasicObjects f9b2227
Jeremy Kemper jeremy Fix AR json encoding 63d0c33
Jeremy Kemper jeremy Clearer String#first and #last edge cases. Fix that 'foo'.first(0) ==…
… 'foo' instead of ''
Pratik lifo Vendor Rack edge ( commit : 815342a ) 5fb66a3
Jun 09, 2009
Nathan Kontny n8 A test to show that http_authentication needs to fail authentication …
…if the password procedure returns nil. Also includes a fix to validate_digest_response to fail validation if the password procedure returns nil.

Signed-off-by: Michael Koziarski <>
Matt Jones al2o3cr Fix several issues with the 2.3.2 gem loader.
Incorporates the following:

- migrates back small change to gems:build:force from bfc1609 to finish closing #2266.

- unrolls to_proc calls in gems.rake, to match the change in master.

- fixes #2722 by passing the options hash to dependencies during build. (includes a test)

- fixes #2721 by loading the specification directly in from_directory_name. Adds an option to opt-out of specification loading when needed (in gems:refresh_specs, for instance). Includes tests.

- fixes #2679 by refreshing specs for all frozen gems rather than just gems loaded from the environment.

- fixes #2678 by passing the options hash to dependencies during unpack.

Signed-off-by: Michael Koziarski <>
Michael Koziarski NZKoz Revert "Ensure HasManyThroughAssociation#destroy delete orphan records"
This reverts commit 7a85927.

There's still some debate about the intended behaviour in the ticket, leaving in master but removing prior to shipping 2.3.3
Tom Ward tomafro Change autoload declaration in ActionView::Helpers from JavascriptHel…
…per to JavascriptHelper, matching the actual helper name. Also removed require from UrlHelper which was inadvertently preventing the autoload typo from causing a failure.

Signed-off-by: Michael Koziarski <>
Eugene Pimenov libc PostgreSQL adapter should call thread safe quote_string function
Signed-off-by: Michael Koziarski <>
Steven Luscher steveluscher Fixes #2439. ActionController::Integration::Session no longer mangles…
… multiparameter attribute params when processing multipart requests.

Signed-off-by: Michael Koziarski <>
Friedrich Göpel 1.9 compatibility - don't pass an array as the from address as this e…
…nds up generating invalid SMTP commands.
David Stevenson dsboulder Made label target radio button tags with values. Radio button now res…
…pects inherited :index options when generating id.

Signed-off-by: Michael Koziarski <>
Stephen Anderson Sanitized the id generated by text_area_tag helper method. text_area_…
…tag('item[description]') should return: <textarea id="item_description" name="item[description]"></textarea> instead of: <textarea id="item[description]" name="item[description]"></textarea> The old id was causing HTML validation failures.

Signed-off-by: Michael Koziarski <>
Jeremy Kemper jeremy Remove dead AbstractRequest autoload 7e1bcef
Jun 10, 2009
Matt Jones al2o3cr Fix incorrect specification path in GemDependency#from_directory_name
Signed-off-by: Michael Koziarski <>
Michael Koziarski NZKoz Whitelist the methods which are called by multiparameter attribute as…

This prevents users from causing NoMethodErrors and the like by editing the parameter names, and closes a potential exploit of CVE-2009-1904.
Jun 11, 2009
Andrew Kaspick akaspick allow absolute paths for the asset caches
Signed-off-by: Michael Koziarski <>
Joshua Peek josh Vendor rack 1.0.x stable 25fde77
Jeremy Kemper jeremy Update memcache-client to 1.7.4 for cheaper timeouts cb9429a
Jun 13, 2009
Luca Guidi Bytes calculation speed up
[#2800 state:committed]

Signed-off-by: Jeremy Kemper <>
Jun 15, 2009
Joshua Peek josh Add :concat option to asset tag helpers to force concatenation.
This is useful for working around IE's stylesheet limit.

  stylesheet_link_tag :all, :concat => true
Jun 18, 2009
Jeremy Kemper jeremy Delegated methods report the expected file/line in backtraces b75bc05
Jeremy Kemper jeremy Friendlier runtime exception if delegatee is nil 8b9b954
Jeremy Kemper jeremy Turn on autolist for debugging also 2255474
Jun 25, 2009
Joshua Peek josh send_data should set Content-Length as a string 6720b25
Jun 27, 2009
Michael Koziarski NZKoz Make filter_parameters work correctly with array parameters.

Chris Mear chrismear Make text_area_tag escape contents by default.
Signed-off-by: Michael Koziarski <>
Jul 01, 2009
Yehuda Katz + Carl Lerche Accept Symbol for contoller name [#2855 state:resolved]
Signed-off-by: Yehuda Katz + Carl Lerche <>
Yehuda Katz + Carl Lerche Move mocha down below initial T::U require and bump version to 0.9.7 [#…
…2858 state:resolved]
Jeremy Kemper jeremy Merge branch '2-3-stable' of into 2-3-stable dfdf8e5
Yehuda Katz + Carl Lerche Updates CI to use latest mocha 97ad936
Jeremy Kemper jeremy JSON.escape returns UTF-8 strings
[#2849 state:resolved]
Yehuda Katz + Carl Lerche Fixes bug where Memcached connections get corrupted when an invalid e…
…xpire is passed in [#2854 state:resolved]
Elliot Winkler mcmire Patch FormTagHelper so that when a form tag is created, the div which…
… holds the form authenticity token is set to display:inline [#2846 state:resolved]

Signed-off-by: Yehuda Katz + Carl Lerche <>
Jul 02, 2009
J.D. Hollis jdhollis Only check for built extensions on gem dependencies that are in vendo…
…r/gems. [#2825 state:resolved]

Signed-off-by: Yehuda Katz + Carl Lerche <>
Yehuda Katz + Carl Lerche Fixes a number of tests that inexplicably didn't fail when we committ…
…ed the original patch
Levin Alexander levinalex make #inspect if zero length duration return '0 seconds' instead of e…
…mpty string [#2838 state:resolved]

Signed-off-by: Yehuda Katz + Carl Lerche <>
Jarl Friis My suggestion to fix ticket 2401 [#2401 state:resolved]
Signed-off-by: Yehuda Katz + Carl Lerche <>
Brian Abreu Fixed ActiveSupport::OrderedHash::[] work identically to ::Hash::[] i…
…n ruby 1.8.7 [#2832 state:resolved]

Signed-off-by: Yehuda Katz + Carl Lerche <>
Jesús García Sáez blaxter Allow symbols on routes declaration (:controller and :action values) [#…
…2828 state:resolved]

Signed-off-by: Yehuda Katz + Carl Lerche <>
Jul 07, 2009
Hongli Lai FooBarWidget Mocha >= 0.9.7 is required, otherwise mocking doesn't work. [#2874 st…

Signed-off-by: Yehuda Katz <wycats@yehuda-katzs-macbookpro41.local>
Hongli Lai FooBarWidget Add support for dumping non-standard primary keys when using the SQLi…
…te3 adapter. Fix unit tests so that this feature is tested for all adapters.

Signed-off-by: Yehuda Katz <wycats@yehuda-katzs-macbookpro41.local>
Lawrence Pit lawrencepit Use the i18n gem if present instead of vendor code. [#2871 state:reso…

Signed-off-by: Yehuda Katz <>
Jul 08, 2009
Hongli Lai FooBarWidget Cleanup application after #close has been called on the Rack response…
… body, not when AC::Reload#call is done.

The Rack body might lazily evaluate its output, which is for example the case
if one calls 'render :text => lambda { ... }'. The code which lazily evaluates
the output might use other application classes. So we will want to defer
cleanup until the Rack request is completely finished.

Signed-off-by: Michael Koziarski <>
Michael Koziarski NZKoz Match tests with new reloading behaviour 6a50d6c
Jul 12, 2009
Michael Koziarski NZKoz Prepare version numbers, changelogs and gem dependencies for 2.3.3. 18e68d9
Joshua Peek josh Go back to depending on Rack 1.0.x gem f36d9a6
Joshua Peek josh Correctly setup the rack gem dependency. ae85927
Jul 15, 2009
Szymon Nowak szimek Add primary_key option to belongs_to association
[#765 state:committed]

Signed-off-by: Jeremy Kemper <>
Jul 16, 2009
Michael Koziarski NZKoz Move from referencing the BlueCloth constant directly, to referencing…
… Markdown.

This supports alternative implementations of markdown such as rpeg-markdown or rdiscount, and later releases of bluecloth.  There are some performance issues with earlier releases of bluecloth, and you should probably upgrade.  In the event that you can't you can place the following code into an initializer:

  Markdown = BlueCloth
Jul 19, 2009
Michael Koziarski NZKoz Forgot to bump the railties versions c7bcbb9