Fix default options argument on ActiveRecord::ConnectionAdaptors::Table#column_exists? #1789

Merged
merged 1 commit into from Jul 6, 2011

Projects

None yet

2 participants

@grantneufeld
Contributor

Changed the default value for the options argument on ActiveRecord::ConnectionAdapters::Table#column_exists? from nil to an empty Hash {}.

That method calls through to ActiveRecord::ConnectionAdapters::SchemaStatements#column_exists? which expects options to be a Hash.

When options was nil, an error would occur in cases where the column did exist because the called method attempted to perform a key lookup on options.

(This was committed to the master branch yesterday. @josevalim requested that I also submit it to 3-1-stable #1763 )

@grantneufeld grantneufeld Fix default options argument on ActiveRecord::ConnectionAdaptors::Tab…
…le#column_exists?

Changed the default value for the `options` argument on `ActiveRecord::ConnectionAdapters::Table#column_exists?` from `nil` to an empty Hash `{}`.

That method calls through to `ActiveRecord::ConnectionAdapters::SchemaStatements#column_exists?` which expects `options` to be a Hash.

When `options` was `nil`, an error would occur in cases where the column did exist because the called method attempted to perform a key lookup on options.
88aa2ef
@jake3030 jake3030 pushed a commit to jake3030/rails that referenced this pull request Jun 28, 2011
@lifo bastilian + lifo Make sure db:drop doesn't fail when sqlite db is given by an absolute…
… path [#1789 state:resolved]

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
071f48b
@spastorino spastorino merged commit 3a92bc7 into rails:3-1-stable Jul 6, 2011
@athal7 athal7 pushed a commit to athal7/rails that referenced this pull request Apr 1, 2013
Andrew Thal Add tests to demonstrate form_for issues with a singular resource. Is…
…sue #1769

These failing tests were written in an attempt to demonstrate the issues
discussed in #1789 related to attempting to use form_for with a singular
resource. I am aware from the discussion that the fix will most likely
not be an easy one, but I figured it could be helpful to have tests to
demonstrate the issue, and I hope that these tests serve that purpose.
6534486
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment