Commit Graph

54571 Commits

Author SHA1 Message Date
Matthew Draper
de2135209f Ensure uuid-ossp extension is present before we rely on it 2015-12-15 16:48:20 +10:30
Rafael Mendonça França
87e4481467 Fix travis matrix 2015-12-14 23:45:25 -02:00
Rafael Mendonça França
a780c7ee43 Add ruby-head back in the allow failures group
Travis still don't have a updated version
2015-12-14 23:14:07 -02:00
Rafael Mendonça França
dbf867cfcb Do now allow failures with Ruby 2.3 anymore 2015-12-14 16:32:10 -02:00
Rafael Mendonça França
a02f5e8c34 Test with Ruby 2.3.0 2015-12-14 16:23:02 -02:00
Sean Griffin
1dc1c8e40b Merge pull request #22564 from maximeg/legit_name_errors
Don't catch all NameError to reraise as ActionController::RoutingError
2015-12-14 10:17:42 -07:00
Sean Griffin
4ecabed2f6 Revert "Perform a more efficient query in Relation#any?"
This reverts commit 6d5b1fdf55611de2a1071c37544933bb588ae88e.

`eager_load` and `references` can include hashes, which won't match up
with `references`

A test case has been added to demonstrate the problem
2015-12-14 10:05:53 -07:00
Rafael Mendonça França
207e2ad9e7 Merge pull request #22561 from Cleggameg/patch-2
Update seeds.rb.tt
2015-12-14 14:54:52 -02:00
Paul Clegg
b66ee36ed1 Update seeds.rb.tt
Rahm Emanuel doesn't deserve to be in Rails.
2015-12-14 14:54:44 -02:00
Sean Griffin
8d672a5f92 Merge pull request #22395 from avokhmin/becomes-errors-base-2
`ActiveRecord::Base#becomes` should copy the errors
2015-12-14 09:53:16 -07:00
Sean Griffin
6d5b1fdf55 Perform a more efficient query in Relation#any?
This was changed in 421c81b, as `exists?` blows up if you are eager
loading a polymorphic association, as it'll try to construct a join to
that table. The previous change decided to execute a `count` instead,
which wouldn't join.

Of course, the only time we actually need to perform a join on the eager
loaded values (which would perform a left outer join) is if they're
being referenced in the where clause. This doesn't affect inner joins.
2015-12-14 09:51:56 -07:00
Kasper Timm Hansen
757a566657 Merge pull request #22582 from sikachu/hwia-to_h
Make Parameters#to_h and #to_unsafe_h return HWIA
2015-12-14 17:27:24 +01:00
Sean Griffin
05bb0689c9 Fix test failures caused by 574f255
There was a test remaining for PG only that was checking for an exact
limit clause
2015-12-14 09:20:07 -07:00
Vokhmin Alexey V
61e5081404 ActiveRecord::Base#becomes should copy the errors 2015-12-14 19:02:20 +03:00
Sean Griffin
574f255629 Use a bind param for LIMIT and OFFSET
We currently generate an unbounded number of prepared statements when
`limit` or `offset` are called with a dynamic argument. This changes
`LIMIT` and `OFFSET` to use bind params, eliminating the problem.

`Type::Value#hash` needed to be implemented, as it turns out we busted
the query cache if the type object used wasn't exactly the same object.

This drops support for passing an `Arel::Nodes::SqlLiteral` to `limit`.
Doing this relied on AR internals, and was never officially supported
usage.

Fixes #22250.
2015-12-14 08:40:02 -07:00
Prem Sichanugrist
6d4aef984c Make Parameters#to_h and #to_unsafe_h return HWIA
This makes these two methods to be more inline with the previous
behavior of Parameters as Parameters used to be inherited from HWIA.

Fixes #21391
2015-12-14 10:28:54 -05:00
Sean Griffin
4358b0d1f8 Deprecate limit strings with commas
Some backends allow `LIMIT 1,2` as a shorthand for `LIMIT 1 OFFSET 2`.
Supporting this in Active Record massively complicates using bind
parameters for limit and offset, and it's trivially easy to build an
invalid SQL query by also calling `offset` on the same `Relation`.

This is a niche syntax that is only supported by a few adapters, and can
be trivially worked around by calling offset explicitly.
2015-12-14 08:19:47 -07:00
Sean Griffin
9a17ce8878 Merge pull request #22463 from tjblonsk/add_bug_report_to_contributing_md
Add specific bug reporting guidelines to contributing.md [ci skip]
2015-12-14 07:56:37 -07:00
Sean Griffin
ef2744dd94 Merge pull request #22209 from yui-knk/add_test_sanitize_sql_array_handles_named_bind_variables
Add test cases for `#sanitize_sql_array` with named_bind_variables
2015-12-14 07:42:32 -07:00
eileencodes
2dd64a7bbb Revert "Merge pull request #22569 from seuros/remove-test-case"
This reverts commit 9712a7a12b7f9e4dcef751ceda8a73c3f4beb11f, reversing
changes made to 3e65c3d3886336e9145438cdeacaf4ebec6a48b8.

Reverting because this caused test failures and while we have a followup
branch there is still one failure that happens randomly and isn't
straight forward to fix.
2015-12-13 21:24:40 -05:00
Santiago Pastorino
0b224ddd55 Merge pull request #22571 from mtsmfm/travel-back
travel back
2015-12-13 22:47:47 -03:00
Eileen M. Uchitelle
9712a7a12b Merge pull request #22569 from seuros/remove-test-case
Controller generators should be creating IntegrationTest stubs instea…
2015-12-13 16:19:30 -05:00
Kasper Timm Hansen
3e65c3d388 Merge branch 'rails-rake-proxy' 2015-12-13 21:44:03 +01:00
Dharam Gollapudi
52f2f9810e Implement Rake proxy for Rails' command line interface.
Allows any Rake task to be run through `bin/rails` such as `bin/rails db:migrate`,
`bin/rails notes` etc.

The Rake tasks are appended to Rails' help output, and blend in as standard commands.
2015-12-13 20:59:41 +01:00
Kasper Timm Hansen
02eef9459a Merge pull request #22574 from gsamokovarov/scaffold-500
Prevent a 500 in the default controller scaffold
2015-12-13 20:57:51 +01:00
Kasper Timm Hansen
8404aa2a72 Merge pull request #22573 from gsamokovarov/web-console-3-0
Update web-console to 3.0.0
2015-12-13 20:34:46 +01:00
Kasper Timm Hansen
d8f993fa7d Nodoc Rails command.
The API isn't ready yet, which means we haven't documented it.

People can't make their own commands, so there's no reason to show it
in generated documentation.
2015-12-13 20:22:38 +01:00
Genadi Samokovarov
c83ace7b6a Prevent a 500 in the default controller scaffold
If you update a record with no attributes, you'll hit a 500 from a guard
in `assign_attributes` raising:

```ruby
ArgumentError: When assigning attributes, you must pass a hash as an argument.
    app/controllers/users_controller.rb:44:in `block in update'
    app/controllers/users_controller.rb:43:in `update'
    test/controllers/users_controller_test.rb:37:in `block in <class:UsersControllerTest>'
```

Not a biggie, but may be quite confusing for the folks new to the
framework.
2015-12-13 20:18:19 +01:00
Arthur Nogueira Neves
72c62421d7 Merge pull request #22572 from prathamesh-sonpatki/fix-paintit-method-in-guides
Fix paintIt method in JavaScript guides [ci skip]
2015-12-13 13:14:55 -05:00
Xavier Noria
a94d404510 lazy load listen in core
See the rationale in the comment present in this patch.
2015-12-13 18:59:34 +01:00
Xavier Noria
7223596259 let config.file_watcher be the way to enable the evented file watcher
Before this commit, the sole presence of the Listen constant
enabled the evented file watcher (unless listen resorted to
the polling backend).

This way, applications may depend on listen for other stuff
independently of this feature. Also, allows teams with mixed
setups to decide at boot time whether the evented watcher
should be enabled for each particular instance.
2015-12-13 18:47:42 +01:00
Genadi Samokovarov
3ba44275f6 Update web-console to 3.0.0
Web Console 3.0.0 is compatible with Rails 5, while the 2.x.x releases
aren't.
2015-12-13 18:10:46 +01:00
Kasper Timm Hansen
6be27016df [ci skip] Fix articles spelling.
Tiny typo in the testing guide; articules should be articles.
2015-12-13 14:58:20 +01:00
Prathamesh Sonpatki
c8350949d9 Fix paintIt method in JavaScript guides [ci skip]
- Changed "paintIt" to "@paintIt" so that it can be called in an on
  click handler.
- Closes #22568
2015-12-13 09:20:54 +05:30
Aaron Patterson
2de7385cef Merge pull request #22381 from yahonda/use_adapter_subsecond_precision_supported
Use adapter supports_datetime_with_precision
2015-12-13 12:13:22 +09:00
Fumiaki MATSUSHIMA
f4e3eca90c travel back 2015-12-13 11:34:40 +09:00
Abdelkader Boudih
5541d640cf Controller generators should be creating IntegrationTest stubs instead of ControllerTest 2015-12-13 01:06:03 +00:00
eileencodes
cd355a8eeb Fix spacing on CHANGELOG name
So that it appears correctly in the CHANGELOG on github.
2015-12-12 14:44:59 -05:00
eileencodes
4414c5d179 Remove ActionController::TestCase from documentation
In Rails 5.1 `ActionController::TestCase` will be moved out of Rails
into it's own gem.

Please use `ActionDispatch::IntegrationTest` going foward.

Because this will be moved to a gem I used `# :stopdoc:` instead of
deleting the documentation. This will remove it from the Rails
documentation but still leave the method documented for when we move it
to a gem.

Guides have been updated to use the routing structure used in Integration
and all test examples have been updated to inherit from
`ActionDispatch::IntegrationTest` instead of `ActionController::TestCase.

Fixes #22496
2015-12-12 14:44:50 -05:00
Maxime Garcia
d3dd3847bc Don't catch all NameError to reraise as ActionController::RoutingError #22368 2015-12-12 11:22:08 +01:00
Tim
dd2fc62fde Add specific bug reporting guidelines to contributing.md. [ci skip]
Add boldface and bullets to make more readable.

Make sentences declarative.

Remove "you"s.
2015-12-11 21:34:42 -05:00
Arthur Nogueira Neves
eb0e8e216f Merge pull request #22511 from jonatack/redirect-to-302
Show redirect response code in assert_response messages
2015-12-11 13:12:33 -05:00
Arthur Neves
a42770cdd8 Revert "Merge pull request #22502 from maclover7/remove-deprecation-notice"
This reverts commit c2e70ca9b042a3461aac0dc073a80e84bd77eb57, reversing
changes made to b0e5fc2737ed0b2f67f9b9538d01e084545493fd.

this broke the build
2015-12-11 12:54:51 -05:00
Jon Atack
c6fe614e45 Show redirect response code in assert_response messages
Follow-up to PR #19977, which helpfully added the redirection path to the error message of assert_response if response is a redirection, but which removed the response code, obscuring the type of redirect.

This PR:

- brings back the response code in the error message,

- updates the tests so the new messages can be tested,

- and adds test cases for the change.
2015-12-11 18:18:08 +01:00
Arthur Nogueira Neves
c2e70ca9b0 Merge pull request #22502 from maclover7/remove-deprecation-notice
Remove unused deprecation notice
2015-12-11 11:39:51 -05:00
Rafael França
b0e5fc2737 Merge pull request #22514 from prathamesh-sonpatki/use-assert-over-assert-predicate
Use assert over assert_predicate in assert_response
2015-12-11 14:11:15 -02:00
Rafael França
8570c806bf Merge pull request #22554 from y-yagi/fix_link_to_coc
fix links to code of conduct [ci skip]
2015-12-11 00:39:13 -02:00
yuuji.yaginuma
abc7b88e75 fix links to code of conduct [ci skip]
CoC text has been moved to the Rails website in 90bcb6d
2015-12-11 09:05:56 +09:00
Claudio B
39309d1347 Merge pull request #22553 from jtwarren/patch-1
Correct the time comparison for remember_me token
2015-12-10 12:30:49 -08:00
Jeffrey Warren
7564da46f2 Correct the time comparison for remember_me token
Corrects the time comparison to be `Time.now < time` which allows the user to
be set only when the current time is less than the 2 week window given in the
example.
2015-12-10 14:42:41 -05:00