Commit Graph

27964 Commits

Author SHA1 Message Date
Aaron Patterson
941f0196c6 schema cache already has the columns as a hash, so use that
Commits

  978ec98c8e and
  51676652a3

changed database statements to use the schema_cache methods, added on
master in

  c99e34e90d763c52cbe8dc3d950ed1b4db665dc4 and
  dc973e78560a6514ab172f0ee86dc84a9147d39a

But apparently the methods weren't added to schema_cache, resulting in
the failure described in #8322 for 3-2-stable.

Fixes #8322.

Conflicts:
	activerecord/lib/active_record/connection_adapters/schema_cache.rb
2012-11-26 17:47:04 -02:00
Carlos Antonio da Silva
17d64a1c52 Merge pull request #8325 from steveklabnik/backport_7997
@steveklabnik can't spell 'distance.' [ci skip]
2012-11-26 10:59:23 -08:00
Steve Klabnik
767879c5d8 @steveklabnik can't spell 'distance.' 2012-11-26 10:56:24 -08:00
Rafael Mendonça França
924018ff5c Merge pull request #8321 from steveklabnik/backport_7997
Add i18n scope to disance_of_time_in_words.
2012-11-26 10:43:23 -08:00
Steve Klabnik
1a876f6228 Add i18n scope to disance_of_time_in_words.
This is a backport of rails/rails#7997.
2012-11-26 10:41:20 -08:00
Aaron Patterson
51676652a3 schema cache already has the columns as a hash, so use that 2012-11-25 23:13:26 -08:00
Aaron Patterson
978ec98c8e speed up fixture loading by querying the schema cache for column names 2012-11-25 23:12:29 -08:00
Carlos Antonio da Silva
6fe1a4a2da Merge pull request #8311 from alisdair/dirty-nullable-datetime
Don't call will_change! for datetime nil->"".

Setting a nil datetime attribute to a blank string should not cause the
attribute to be dirty.

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
2012-11-25 22:55:20 -02:00
Rafael Mendonça França
83e7105125 Merge pull request #8295 from senny/8265_backport
backport #8291, prevent mass assignment of polymorphic type with `build`
2012-11-22 06:47:44 -08:00
Yves Senn
d397a38c02 backport #8291, prevent mass assignment of polymorphic type with build
Closes #8265

Conflicts:

	activerecord/CHANGELOG.md
	activerecord/lib/active_record/associations/association.rb
2012-11-22 15:08:17 +01:00
Rafael Mendonça França
4e00e8e916 Merge pull request #8280 from asanghi/fix_guide_field_with_error_proc
fix guide with field_with_error proc example

[ci skip]
2012-11-20 21:54:06 -02:00
Rafael Mendonça França
50f00463bd Merge pull request #8276 from pwnall/pgsql_text_limits
Postgresql doesn't accepts limits on text columns
Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
2012-11-20 14:13:45 -02:00
Carlos Antonio da Silva
bd87bd9564 Be a bit less conservative with mysql in adapter
This will allow the new mysql 2.9.0 to be used, fixing our test issues.
2012-11-19 20:54:04 -02:00
Carlos Antonio da Silva
0077b414db Merge pull request #8258 from kommen/eager_loading_with_select_test2
Add test to ensure preloading works as expected with "group", "select" and "includes".
Conflicts:
	activerecord/test/cases/relations_test.rb

Chery-pick a739340d3c9e66814429af6f3f410c01ff86810a:
Ensure ordering to make the test pass with postgresql

Conflicts:
	activerecord/test/cases/relations_test.rb
2012-11-19 20:28:33 -02:00
Rafael Mendonça França
db6765220d Merge pull request #8271 from senny/backport_8262
backport #8262, require bundler groups to include rake-tasks in engines
2012-11-19 08:25:46 -08:00
Yves Senn
da6951af63 backport #8262, require bundler groups to include rake-tasks in engines
If you generate a full engine, this will include rake tasks from
your gem under the `app` namespace. For example if you have a dependency
on `rspec-rails` in your engine's `gemspec`. You will get the task `app:spec`

Closes #8229

Conflicts:

	railties/CHANGELOG.md
2012-11-19 15:23:49 +01:00
Mikel Lindsaar
b18fc59d28 Upgrade mail dependency to 2.5.2 2012-11-18 15:55:33 +11:00
Mikel Lindsaar
a497f84bb2 Upgrade mail dependency to 2.5.0 2012-11-18 10:43:48 +11:00
Carlos Antonio da Silva
603f538feb Remove the git option from ruby-prof gem pointing to wycats repo.
According to him, at one point his fork was the one that had the call
stack printer, and it's in the main repo now.

[ci skip]
2012-11-16 23:45:43 -02:00
Carlos Antonio da Silva
ff5d606368 Add changelog entry for #6003 backport 2012-11-16 21:50:13 -02:00
Andrew White
0c7a236f30 Refactor Generator class to not rely on in-place editing the controller 2012-11-16 21:44:24 -02:00
Nikita Beloglazov
09c4dfa06b Fix bug when url_for changes controller. 2012-11-16 21:44:18 -02:00
Carlos Antonio da Silva
88a296dccc Merge pull request #7983 from georgebrock/bug7950-squashed
Backport 4bc2ae0 to fix #7950

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/relation/calculations.rb
2012-11-16 21:15:34 -02:00
José Valim
666a7e34f5 Merge pull request #8235 from tilsammans/dont_escape_actionmailer_when_plaintext
Introduce `ActionView::Template::Handlers::ERB.escape_whitelist`

Conflicts:
	actionpack/CHANGELOG.md
	actionpack/test/template/template_test.rb
2012-11-16 09:59:15 -02:00
Rafael Mendonça França
f2a98a9243 Merge pull request #8227 from senny/backport_8139
backport #8139, `plugin new` adds dummy app tasks when necessary
2012-11-15 09:48:06 -08:00
Yves Senn
e69058c153 backport #8139, plugin new adds dummy app tasks when necessary. …
The `plugin new` generator always adds the dummy app rake tasks,
when a dummy app was created.

Closes #8224

Conflicts:

	railties/CHANGELOG.md
2012-11-15 18:45:37 +01:00
David Padilla
00fbee5bbf Fixes issue #6251
Plugin generator crashes when using the --dummy-path option

Code was assuming the application name in `config/application.rb`
was module Dummy.
2012-11-15 18:28:17 +01:00
Carlos Antonio da Silva
492c8de433 Merge pull request #8218 from DawidJanczak/form-tag-doc
[ci skip] Correct examples for form_tag helper.
2012-11-14 04:06:32 -08:00
DawidJanczak
89a8143d36 [ci skip] Correct examples for form_tag helper. 2012-11-14 11:56:15 +00:00
Jon Leighton
1edd358177 fix test
Conflicts:
	activerecord/test/cases/locking_test.rb
2012-11-13 20:22:35 -02:00
Rafael Mendonça França
7240202784 Merge pull request #8209 from senny/backport_8176
backport #8176, `#pluck` can be used on a relation with `select` clause.

Conflicts:
	activerecord/CHANGELOG.md
2012-11-13 19:58:26 -02:00
Rafael Mendonça França
e4e2bcce75 Merge pull request #8204 from nikitug/fix_dynamic_finder_result_check
Use nil? instead of blank? to check dynamic finder result

Conflicts:
	activerecord/CHANGELOG.md
2012-11-13 19:55:26 -02:00
Carlos Antonio da Silva
aac032073d Merge pull request #8188 from courtland/habtm-fix-stable
Fix deleting from a HABTM join table upon destroying an object of a mode...
2012-11-13 11:06:40 -08:00
Nick Rogers
05e1466e05 Fix deleting from a HABTM join table upon destroying an object of a model with optimistic locking enabled. Fixes #5332. 2012-11-13 10:36:24 -08:00
Nikita Afanasenko
b56376b450 Use nil? instead of blank? to check dynamic finder result
It's safe to use `nil?` instead of `blank?` because it's impossible to get an array on finder with bang;
`all_by` finder matches against regex without bang: `when /^find_(all_|last_)?by_([_a-zA-Z]\w*)$/`.

Fixes #7238
2012-11-13 21:24:58 +04:00
Rafael Mendonça França
5ed0381db5 Merge pull request #8205 from kennyj/fix_6951-32
Backport #8074 to 3-2-stable. Use query cache/uncache, when using not only database.yml but also DATABASE_URL.
2012-11-13 08:20:38 -08:00
kennyj
fda9075530 Backport #8074 to 3-2-stable. Use query cache/uncache, when using not only database.yml but also DATABASE_URL. 2012-11-14 00:22:33 +09:00
Yves Senn
d3006f3503 backport #8176, #pluck can be used on a relation with select clause.
Conflicts:

	activerecord/CHANGELOG.md
	activerecord/lib/active_record/relation/calculations.rb
	activerecord/test/cases/calculations_test.rb
2012-11-13 15:50:11 +01:00
Carlos Antonio da Silva
267fb61277 Revert "Use MiniTest in Ruby 1.8 if it is available."
This reverts commit c3e186ec8d.

Reason: too many incompatibilities make a lot of Rails tests fail in 1.9.
Might need more work to get this done properly in 3-2 if necessary.
2012-11-13 11:01:35 -02:00
Carlos Antonio da Silva
cd5b2e1e56 Fix warning with assigned but not used variable 2012-11-13 10:17:07 -02:00
Carlos Antonio da Silva
47971c85df Add changelog entry for #8200 [ci skip] 2012-11-13 09:29:41 -02:00
Carlos Antonio da Silva
17ccefc436 Update mocha version to 0.13.0 and change requires 2012-11-13 09:24:43 -02:00
Carlos Antonio da Silva
25b23d7ecc Fix json encoding test with ruby 1.8.7 and random hash order
Introduced in 3e53fe6.
2012-11-13 09:17:48 -02:00
Carlos Antonio da Silva
0ed585adeb Merge pull request #8200 from freerange/3-2-stable-with-mocha-fixes
Fix 3-2-stable to work with Mocha v0.13.0
2012-11-13 02:34:42 -08:00
Carlos Antonio da Silva
3e53fe635c Merge pull request #8199 from senny/backport_8182
backport #8185, `#as_json` isolates options when encoding a hash.
2012-11-13 02:26:01 -08:00
James Mead
3791cac874 Avoid a Mocha deprecation warning. 2012-11-13 08:25:14 +00:00
James Mead
5573c1d295 Fix for Test::Unit Mocha compatibility.
Mocha is now using a single AssertionCounter which needs a reference to
the testcase as opposed to the result.

This change is an unfortunate consequence of the copying of a chunk of
Mocha's internal code in order to monkey-patch Test::Unit.
2012-11-13 08:25:14 +00:00
James Mead
c3e186ec8d Use MiniTest in Ruby 1.8 if it is available.
ActiveSupport::TestCase was always inheriting from Test::Unit::TestCase.
This works fine in Ruby 1.9 where Test::Unit::TestCase is a thin wrapper
around MiniTest::Unit::TestCase, but does not work in Ruby 1.8 if the
MiniTest gem is used. What happens is that ActiveSupport inherits from
the Test::Unit::TestCase provided by the standard library, but then
since Minitest is defined, it then seems to proceed on the assumption
that ActiveSupport::TestCase has MiniTest::Unit::TestCase in its
ancestor chain. However, in this case it does not.

The fix is simply to choose which test library TestCase to inherit from
using the same logic used elsewhere to detect MiniTest.

I noticed this bug causing issues when using MiniTest and Mocha
in Ruby 1.8, but there may well be other issues.
2012-11-13 08:25:14 +00:00
James Mead
716bdfc01d Copy Mocha bug fix.
A bug was fixed [1] in Mocha's integration with Test::Unit, but this
monkey-patching code was copied before the fix. We need to copy the
fixed version.

The bug meant that an unexpected invocation against a mock within the
teardown method caused a test *error* and not a test *failure*.

[1]
f1ff6475ca (diff-5)
2012-11-13 08:25:14 +00:00
Yves Senn
be79632b96 backport #8185, #as_json isolates options when encoding a hash.
Setting options in a custom `#as_json` method had side effects.
Modifications of the `options` hash leaked outside and influenced
the conversion of other objects contained in the hash.

Conflicts:

	activesupport/CHANGELOG.md
2012-11-13 08:44:47 +01:00