Commit Graph

53704 Commits

Author SHA1 Message Date
Claudio B.
ee2c093210 Merge pull request #21934 from etdev/docs/deep-dup-typo
[ci skip] Fix typo in deep_dup docs
2015-10-11 23:10:46 -07:00
Eric Turner
dfedaf3795 [ci skip] Fix typo in deep_dup docs 2015-10-12 14:05:53 +09:00
Jeremy Daer
f50d953ff6 Merge pull request #11410 from bogdan/increment-concurency
Make AR#increment! and #decrement! concurrency-safe
2015-10-10 13:24:54 -07:00
Rafael Mendonça França
c61826eebc Merge pull request #20940 from rafaelsales/allow-multiple-root-routes
Allow multiple `root` routes in same scope level
2015-10-10 14:54:35 -03:00
Rafael Sales
4db921a8e7 Allow multiple root routes in same scope level
When an application has multiple root entries with different
constraints, the current solution is to use `get '/'`. Example:

**Currently I have to do:**
```ruby
get '/', to: 'portfolio#show', constraints: ->(req) { Hostname.portfolio_site?(req.host) }
get '/', to: 'blog#show',      constraints: ->(req) { Hostname.blog_site?(req.host) }
root 'landing#show'
```

**But I would like to do:**
```ruby
root 'portfolio#show', constraints: ->(req) { Hostname.portfolio_site?(req.host) }
root 'blog#show',      constraints: ->(req) { Hostname.blog_site?(req.host) }
root 'landing#show'
```

Other URL matchers such as `get`, `post`, etc, already allows this, so I
think it's fair that `root` also allow it since it's just a shortcut for
a `get` internally.
2015-10-10 08:22:31 -03:00
Jeremy Daer
0450642c27 Merge pull request #21631 from RobinClowers/fix-cache-instrumentation
Fix cache fetch instrumentation
2015-10-09 13:58:49 -07:00
Rafael Mendonça França
5c7e992578 Merge pull request #21927 from ronakjangir47/remove_is_a_spec
used predicate methods to avoid is_a? checks
2015-10-09 17:33:52 -03:00
Rafael Mendonça França
e33de7de4d Merge pull request #21928 from Gaurav2728/update_ruby_oracle_gem
update to ruby-oci8 - 2.2.0
2015-10-09 17:31:32 -03:00
Gaurav Sharma
03f4b9468e update to ruby-oci8 - 2.2.0
It stopped `ruby 1.8` support, we already switched to `ruby >= 2.2.2`
2015-10-10 00:34:49 +05:30
Ronak Jangir
ee47e34d82 used predicate methods to avoid is_a? checks 2015-10-10 00:05:36 +05:30
Matthew Draper
30bacc26f8 Merge pull request #21878 from Gaurav2728/require_monitor
monitor is require for SneakersAdapter
2015-10-10 02:42:11 +10:30
Sean Griffin
64476e9194 Merge pull request #21912 from y-yagi/move_prepare_destination_to_public
change `prepare_destination` to public API [ci skip]
2015-10-08 18:03:24 -06:00
Matthew Draper
1b6fcae948 Avoid leaking the first relation we call #first on
With the previous implementation, the block passed to
define_singleton_method, which will live forever as the method body,
captures the parameters (args and block) in its enclosure.

For the current_scope registry, that can include an AR::Relation.
2015-10-09 07:09:57 +10:30
Rafael Mendonça França
2f5ceffdfa Merge pull request #21911 from tommyblue/master
Modify the scope method documentation
2015-10-08 14:21:09 -03:00
Rafael Mendonça França
a7bd1c7c88 Merge pull request #21894 from abhishekjain16/refactor_with_dry
Follow DRY principle and remove duplication
2015-10-08 14:16:46 -03:00
Abhishek Jain
9a57e7f9bb Follow DRY principle and remove duplication 2015-10-08 22:33:55 +05:30
Arthur Nogueira Neves
0d4aa374a2 Merge pull request #21919 from akihiro17/remove-require
Remove unused require
2015-10-08 10:58:23 -04:00
akihiro17
d985c5d23e Remove unused require
`require 'active_support/core_ext/string/filters'` was added in b3bfa36. However, it is no longer needed from 3ae981814.
2015-10-08 23:48:21 +09:00
Claudio B.
bd65ba7721 Merge pull request #21906 from scottgonzalez/form-helpers
Minor cleanup for form helpers guide
2015-10-08 07:25:41 -07:00
Santiago Pastorino
326f303c78 Merge pull request #21917 from y-yagi/remove_unused_require
remove unused require
2015-10-08 12:14:01 -02:00
Sean Griffin
4516bb93e9 Merge pull request #21913 from kamipo/fix_subsecond_precision_supported_version
Fix subsecond precision supported version
2015-10-08 08:06:47 -06:00
Sean Griffin
8a6cfbf3ac Merge pull request #21891 from AndyLampert/small-csrf-section-readability-improvements
Improve readability in CSRF section of guide [ci skip]
2015-10-08 07:48:33 -06:00
Scott González
8be6b47d1f Minor cleanup for form helpers guide [ci skip] 2015-10-08 08:48:56 -04:00
yuuji.yaginuma
9b4ec029f6 remove unused require
`shellwords` is no longer needed from #20605.
2015-10-08 21:12:07 +09:00
Andrew White
c750ca5da8 Merge pull request #21686 from kamipo/remove_pk_and_sequence_for
Remove unused `pk_and_sequence_for` in AbstractMysqlAdapter
2015-10-08 10:28:03 +01:00
Ryuta Kamizono
94d2499156 Fix subsecond precision supported version
Fractional Seconds supported version is 5.6.4 or higher.

http://dev.mysql.com/doc/refman/5.6/en/fractional-seconds.html
2015-10-08 18:20:30 +09:00
yuuji.yaginuma
46784703e2 change prepare_destination to public API [ci skip]
`prepare_destination` has been used in the template file for the generator,
I think it should be a public API

ref: https://github.com/rails/rails/blob/master/railties/lib/rails/generators/test_unit/generator/templates/generator_test.rb#L8
2015-10-08 17:57:58 +09:00
Tommaso Visconti
e2a4224352 Modify the scope method documentation
Adds a paragraph to the documentation of the `ActiveRecord::Scoping::Named.scope` method,
explaining that the method is intended to return an ActiveRecord::Relation object to be
composable with other scopes.

In the case that in the case that `nil` or `false` are returned, the method returns
an `all` relation instead.
This unexpected behaviour is mentioned in #19249 #14256 #21465 and #21882 and wasn't
documented at all. This commit adds this documentation.
2015-10-08 10:29:05 +02:00
Andy Lampert
705847578e Improve readability in CSRF section of guide 2015-10-07 22:11:34 -06:00
Xavier Noria
eaa0cb7924 code gardening in transliterate.rb
Saw this while doing a review of a patch:

* Normalize case and punctuation across comments.
* ascii -> ASCII
* Since I was on it, some blank lines that visually
  add some clarity IMO.
2015-10-07 23:44:04 +02:00
Andrew White
fef1064052 Merge pull request #21804 from merhard/mounted_engine_route_fix
Mounted engine route fix
2015-10-07 22:25:39 +01:00
Kasper Timm Hansen
54f3a18eec Output inline is set to true in the plugin.
Change the reporter to just read the option.

Pass output_inline where needed in tests.
2015-10-07 22:49:41 +02:00
Kasper Timm Hansen
11a3e02237 Refactor create_test_file to take a pass option.
Lets us cut the verbose and straight up duplicated setup in 3 tests down to one line.
2015-10-07 22:49:41 +02:00
Kasper Timm Hansen
da832016bf Hide Minitest's aggregated results if outputting inline.
We'd see the failures and errors reported after the run, which is needless, when we've already
reported them.

Turns:

```

.......................................S....................F

This failed

bin/rails test test/models/bunny_test.rb:14

....

Finished in 0.100886s, 1020.9583 runs/s, 1001.1338 assertions/s.

  2) Failure:
BunnyTest#test_something_failing [/Users/kasperhansen/Documents/code/collection_caching_test/test/models/bunny_test.rb:15]:
This failed

103 runs, 101 assertions, 1 failures, 0 errors, 1 skips

You have skipped tests. Run with --verbose for details.
```

Into:

```

...................S.......................................F

This failed

bin/rails test test/models/bunny_test.rb:14

......................

Finished in 0.069910s, 1473.3225 runs/s, 1444.7143 assertions/s.

103 runs, 101 assertions, 1 failures, 0 errors, 1 skips
```
2015-10-07 22:49:41 +02:00
Richard Schneeman
5ddf6df966 Merge pull request #21904 from morgoth/missing-test-for-not-modifing-queues
Added missing specs for not modifying queues when using AJ test helpers
2015-10-07 15:39:42 -05:00
Rafael Mendonça França
172c25e7b6 Revert "Update asset_pipeline.md"
This reverts commit afe672185d5eba95f387c46f855ae7a21ea69fa5.

Reason: This change was done by mistake. This option is at the `config`
object not in the `config.assets`.

See
cfb371e96a/railties/lib/rails/application/configuration.rb (L16)
2015-10-07 15:46:04 -03:00
Ryuta Kamizono
fd37486e07 Remove unused pk_and_sequence_for in AbstractMysqlAdapter
`pk_and_sequence_for` is implemented for PG and MySQL adapters (not
implemented for Sqlite3 adapter). But MySQL adapters are not using
`pk_and_sequence_for` already.
2015-10-08 03:17:02 +09:00
Wojciech Wnętrzak
c2854af747 Added missing specs for not modifying queues when using AJ test helpers 2015-10-07 20:02:15 +02:00
Matthew Erhard
bcfbd8ba21 Fix mounted engine named routes regression
When generating the url for a mounted engine through its proxy, the path should be the sum of three parts:

1. Any `SCRIPT_NAME` request header or the value of `ActionDispatch::Routing::RouteSet#relative_url_root`.
2. A prefix (the engine's mounted path).
3. The path of the named route inside the engine.

Since commit 44ff0313c1, this has been broken. Step 2 has been changed to:

2. A prefix (the value of `ActionDispatch::Routing::RouteSet#relative_url_root` + the engine's mounted path).

The value of `ActionDispatch::Routing::RouteSet#relative_url_root` is taken into account in step 1 of the route generation and should be ignored when generating the mounted engine's prefix in step 2.

This commit fixes the regression by having `ActionDispatch::Routing::RouteSet#url_for` check `options[:relative_url_root]` before falling back to `ActionDispatch::Routing::RouteSet#relative_url_root`. The prefix generating code then sets `options[:relative_url_root]` to an empty string. This empty string is used instead of `ActionDispatch::Routing::RouteSet#relative_url_root` and avoids the duplicate `relative_url_root` value in the final result.

This resolves #20920 and resolves #21459
2015-10-07 12:45:01 -04:00
Rafael Mendonça França
e70ec9e91c Merge pull request #21902 from mparramont/patch-1
Fix "Esperanto" name
2015-10-07 13:00:40 -03:00
Miguel Parramon
6de2813919 Fix "Esperanto" name
Correct spelling is "Esperanto": 

https://en.wikipedia.org/wiki/Esperanto
2015-10-07 17:54:50 +02:00
Richard Schneeman
ffdbfb2704 Merge pull request #21899 from scottgonzalez/layouts-and-rendering-typo
Fix typo in docs
2015-10-07 10:08:38 -05:00
Rafael Mendonça França
a5bd0a385c Merge pull request #21900 from scottgonzalez/contributing-typo
Fix pluralization in docs [ci skip]
2015-10-07 11:52:26 -03:00
Scott González
0070fc7686 Fix pluralization in docs [ci skip] 2015-10-07 10:30:44 -04:00
Scott González
ab62af7c93 Fix typo in docs [ci skip] 2015-10-07 10:27:46 -04:00
Kasper Timm Hansen
80abbd3eea Merge pull request #21895 from abhishekjain16/doc_fix
[ci skip] fix typo
2015-10-07 13:55:10 +02:00
Abhishek Jain
fc4fbac073 [ci skip] fix typo 2015-10-07 15:10:33 +05:30
Arthur Nogueira Neves
27c970f000 Merge pull request #20983 from jameskerr/mailer-preview-url
Update the URL when changing mailer preview formats
2015-10-06 16:57:08 -04:00
Aaron Patterson
895c359182 use methods for accessing the cache control headers
Use the methods rack provides so we don't have to worry about the exact
header key.
2015-10-06 13:39:03 -07:00
Aaron Patterson
cddb700cc2 etag header is in Rack, so use it's response methods
Rack implements the Etag header manipulation methods, so we can use
those instead of ours.
2015-10-06 13:39:03 -07:00