Commit Graph

50431 Commits

Author SHA1 Message Date
Kasper Timm Hansen
37695b8aab Let strip_tags leave HTML escaping to Rails.
Prevents double escaping errors, such as "&" becoming "&".
2015-03-10 20:04:01 +01:00
Sean Griffin
4e7217027f Add YAML compatibility for objects from Rails 4.2
As of Ruby 2.2, Psych can handle any object which is marshallable. This
was not true on previous versions of Ruby, so our delegator types had to
provide their own implementation of `init_with` and `encode_with`.
Unfortunately, this doesn't match up with what Psych will do today.

Since by the time we hit this layer, the objects will have already been
created, I think it makes the most sense to just grab the current type
from the class.
2015-03-10 11:56:45 -06:00
Sean Griffin
afc124c3b4 Attempt to provide backwards compatible YAML deserialization
I should have done this in the first place. We are now serializing an
explicit version so we can make more careful changes in the future. This
will load Active Record objects which were serialized in Rails 4.1.

There will be bugs, as YAML serialization was at least partially broken
back then. There will also be edge cases that we might not be able to
handle, especially if the type of a column has changed.

In addition, we're passing this as `from_database`, since that is
required for serialized columns at minimum. All other types were
serializing the cast value. At a glance, there should be no types for
which this is a problem.

Finally, dirty checking information will be lost on records serialized
in 4.1, so no columns will be marked as changed.
2015-03-10 11:56:45 -06:00
Rafael Mendonça França
08469012e4 Merge pull request #19275 from keepcosmos/remove-autoload-path
remove unnecessary autoload path parameters
2015-03-10 13:57:56 -03:00
Kohei Suzuki
d4103fc232 304 response should not include Content-Type header
Rack::Lint raises an error saying "Content-Type header found in 304
response, not allowed".
2015-03-10 23:39:08 +09:00
Arthur Nogueira Neves
e31f376729 Merge pull request #19273 from Gaurav2728/gaurav-remove_test_after_commit_gem_msg
‘test_after_commit’ gem is not require in Rails 5, remove note from doc ...
2015-03-10 09:59:51 -04:00
Gaurav Sharam
434c768a7d ‘test_after_commit’ gem is not required in Rails 5 remove note from doc 2015-03-10 18:13:07 +05:30
keepcosmos
f7233b27f2 remove unnecessary path parameters 2015-03-10 21:29:59 +09:00
Zachary Scott
221e847a3b Merge pull request #19270 from AndrewHendrie/master
Changed 'blank space' to 'blank line'
2015-03-09 17:22:28 -07:00
Andrew Hendrie
3f0b7b41e1 Changed 'blank space' to 'blank line'
Line 85 stated that fixtures are typically separated by a blank space. I changed the wording to blank line because blank space could be misinterpreted as a non-breaking space character when in reality, each fixture record (in YAML) is separated by a blank line.
2015-03-09 20:20:06 -04:00
Sean Griffin
761b5541b6 Fix intermittent test failures
The table is being modified in tests, without reloading the column
information on the appropriate class. This is leading to incorrect
column information in many cases.

The failures fixed by this commit can be replicated with:

    ARCONN=postgresql ruby -Itest test/cases/adapters/postgresql/hstore_test.rb --seed 21574
2015-03-09 15:52:27 -06:00
eileencodes
2e4a01b92c Call super last in before_setup
This fixes the reasons 4cf3b8a, 303567e, and fa63448 needed to be
reverted in 7142059. The revert has been reverted and this fixes
the issues caused previously.

If we call `super` first we will end up nuking the session settings in the
application tests that do `setup do` - so any session login or cookie
settings will not be persisted thoughout the test sessions.

Calling `super` last prevents `@integration_session` from getting nuked
and set to nil if it's already set.

Test added to prevent regression of this behavior in the future.
2015-03-09 17:11:15 -04:00
eileencodes
d5e55e960c Revert "Revert integration test refactoring that caused app test regressions"
This reverts commit 714205988315d2f98aa3e749747c44470e18676b.
2015-03-09 17:10:24 -04:00
Rafael Mendonça França
094ad22349 Merge pull request #19243 from yui-knk/fix/require
Fix place of require 'rails_guides/markdown'
2015-03-09 11:42:46 -03:00
Sean Griffin
503c2d412a Fix intermittent test failures
The default value of `"pg_arrays"."tags"` is being changed to `[]` in
one test, but the column information on the model isn't reset after it's
changed back. As such, we think the default value is `[]` when in the
database it's actually `nil`. That means any test which was assigning
`[]` to a new record would have that key skipped with partial writes, as
it hasn't changed from the default. However since the *actual* default
value is `nil`, we get back values that the test doesn't expect, and it
fails.
2015-03-09 08:37:28 -06:00
Arthur Nogueira Neves
ba8ce39877 Merge pull request #19264 from y-yagi/plugins_guide
use public Module#include instead of send :include [ci skip]
2015-03-09 10:08:07 -04:00
yuuji.yaginuma
71dcc40a2c use public Module#include instead of send :include [ci skip] 2015-03-09 23:01:51 +09:00
Andrew White
34b27701ee Revert "Take DST into account when locating TimeZone from Numeric."
Reverting this as it's not the implementation that we would like it to be.
This is being used inside of ActiveSUpport::TimeZone[] and it's unaware
of the context in which to find the timezone period so the timezone found
changes depending on whether DST is in effect for the current period.
This means that `'2001-01-01'.in_time_zone(-9)` changes from winter/summer
even though it's the same date that we're trying to convert.

Since finding timezones by numeric offsets is a bit hit and miss we should
introduce a new API for finding them which supplies the date context in
which we want to search and we should probably also deprecate the finding
of timezones via the [] method, though this needs further discussion.

This reverts commit 2cc2fa3633edd96773023c6b09d07c7b9d9b841d.
2015-03-09 13:48:55 +00:00
Yves Senn
309ac642cb Merge pull request #19263 from splattael/target-2.2.1
Target Ruby 2.2.1 in gemspecs
2015-03-09 10:19:59 +01:00
Peter Suschlik
f0768eba28 Target Ruby 2.2.1 in gemspecs
This is a follow-up to #19257
2015-03-09 09:56:26 +01:00
Eileen M. Uchitelle
fb764ba63e Merge pull request #19257 from jvanbaarsen/patch-1
Rails 5.0 needs ruby 2.2.1 or higher
2015-03-08 12:30:26 -04:00
Jeroen van Baarsen
2d7805c627 Rails 5.0 needs ruby 2.2.1 or higher
Since there was a bug in 2.2.0, the minimum ruby requirement is 2.2.1. See https://github.com/rails/rails/commit/8ed0b89b
[skip ci]
2015-03-08 14:03:47 +01:00
Arthur Nogueira Neves
095f4c9da3 Merge pull request #18200 from brainopia/rollback_frozen_records
Fix rollback of frozen records
2015-03-07 18:56:24 -05:00
Eileen M. Uchitelle
96b8f401f5 Merge pull request #19247 from wazery/doc_fix
Doc fixes [ci skip]
2015-03-07 09:28:01 -05:00
Islam Wazery
69db8dc468 Doc fixes [ci skip] 2015-03-07 11:43:15 +00:00
Robin Dupret
ed1ff198f8 Merge pull request #19246 from wazery/patch-1
Doc fix [ci skip]
2015-03-07 12:02:46 +01:00
Islam Wazery
d97b9dde8d Doc fix [ci skip] 2015-03-07 12:47:30 +02:00
yui-knk
ec895167c2 Fix place of require 'rails_guides/markdown' 2015-03-07 16:50:27 +09:00
Kasper Timm Hansen
222f252496 Merge pull request #19242 from y-yagi/integration_test_example
update integration test example as is not output deprecation warning [ci skip]
2015-03-07 08:45:57 +01:00
yuuji.yaginuma
fbb11854c7 update integration test example as is not output deprecation warning [ci skip] 2015-03-07 14:28:47 +09:00
Richard Schneeman
ed9589ee62 Merge pull request #19241 from yui-knk/fix/comment
[ci skip] Fix `AS` and `AR` to full name
2015-03-06 23:02:07 -06:00
yui-knk
6bf2b83700 [ci skip] Fix AS and AR to full name 2015-03-07 13:49:08 +09:00
yui-knk
2a307623a2 Remove gem check in guides/rails_guides.rb
Now rails/Gemfile includes nokogiri and redcarpet,
so remove gem check from guides/rails_guides.rb
2015-03-07 13:38:59 +09:00
Kasper Timm Hansen
387e7be458 Merge pull request #19234 from sivsushruth/doc_fix
Doc fix [ci skip]
2015-03-07 01:02:40 +01:00
Sushruth Sivaramakrishnan
6fe13e5296 Doc fix [ci skip] 2015-03-07 04:38:25 +05:30
Guillermo Iguaran
809527b282 Merge pull request #19231 from prathamesh-sonpatki/fix-url-for-documentation
Fix documentation of url_for module [ci skip]
2015-03-06 15:49:37 -05:00
Abdelkader Boudih
959fd6a8e7 Merge pull request #19233 from sivsushruth/doc_fix
Doc fix [ci skip]
2015-03-06 18:11:04 +00:00
Sushruth Sivaramakrishnan
6a835e26d3 Doc fix [ci skip] 2015-03-06 23:37:54 +05:30
Jeremy Kemper
a3e490419a Fix leaky only: … option for Active Job assertions
The filter was set on the pseudo-global TestAdapter but not restored to
its original value.

See e818f65770fe115ab1cc7fbacc0e7e94d92af6a4
2015-03-06 10:42:49 -07:00
Robin Dupret
e81693a0eb Merge pull request #19230 from prathamesh-sonpatki/fix-clear-doc
Updated documentation of CollectionProxy#clear [ci skip]
2015-03-06 17:35:23 +01:00
Prathamesh Sonpatki
88199f7f03 Updated documentation of CollectionProxy#clear [ci skip]
- CollectionProxy#clear method calls delete_all so the SQL is directly
   run into the database.
 - So the updated_at column of the object on which its run is not
   updated.
 - Closes #17161
2015-03-06 21:53:07 +05:30
Prathamesh Sonpatki
e049319c77 Fix documentation of url_for module [ci skip]
- The request needs to be instance of ActionDispatch::Request or an
   object that responds to host, optional_port, protocol and
   symbolized_path_parameter.
 - This documentation was correctly added in
   e3b3f416b5
   but was changed to
   e1ceae576e.
 - Fixes #16160.
2015-03-06 19:51:07 +05:30
Matthew Draper
c96cb66351 Merge pull request #19221 from matthewd/random-tests
Run all our tests in random order
2015-03-06 23:02:49 +10:30
Yves Senn
deed34d8bd tests, sequences are derived from the base class.
Using a subclass to check the sequence name does not work in that case.
The sequence name will be calucalted based on the base class.
2015-03-06 13:25:07 +01:00
Yves Senn
a068aa3e86 Revert ":cut: remove unnecessary rescue Exceptions"
This reverts commit ff18049ca6f27deb7e7f955478e1464f8d756332.

This broke the AR build for every adapter:

      1) Error:
    AssociationCallbacksTest#test_dont_add_if_before_callback_raises_exception:
    Exception: You can't add a post

      2) Failure:
    QueryCacheTest#test_query_cache_doesnt_leak_cached_results_of_rolled_back_queries [/Users/senny/Projects/rails/activerecord/test/cases/query_cache_test.rb:235]:
    Expected: 1
      Actual: 0

I'm reverting to get the build green again.
2015-03-06 12:16:18 +01:00
Yves Senn
bfbabc59d5 replace repair_validations with a disposable subclass. 2015-03-06 12:06:35 +01:00
Robin Dupret
f927591611 Remove a duplicated changelog entry [ci skip]
This entry now lives in the Action View's changelog ; refs 8a3bd089.
2015-03-06 12:03:51 +01:00
Yves Senn
eac3349285 tests, remove side effects on Joke during base_test.rb.
prompted by #19221.
2015-03-06 10:51:57 +01:00
Yves Senn
90c10500be Merge pull request #19225 from cristianbica/integration-tests
Fixed ActiveJob integration tests
2015-03-06 09:28:50 +01:00
Yves Senn
8a3bd0899f put the changelog entry in the right file 😓 [ci skip] 2015-03-06 09:12:27 +01:00