Commit Graph

50794 Commits

Author SHA1 Message Date
Santiago Pastorino
2c16acde0d Merge pull request #19666 from mikej/master
fix missing "if" in API docs for ActionController::Parameters#permit
2015-04-06 10:47:48 -03:00
Mehmet Emin İNAÇ
1a53549901 drop_table method documentation for mysql and postgresql adapters [ci skip] 2015-04-06 16:15:15 +03:00
eileencodes
188934cdac Fix ActionPack tests after changes to missing template logger
After merging #19377 ActionPack tests were missing a require for
`ActiveSupport::LogSubscriber::TestHelper` and change didn't take
into account that logger could be nil. Added the require and only log to
info if logger exists.

This wasn't caught earlier because these tests only run after a merge.
2015-04-06 09:03:13 -04:00
Eileen M. Uchitelle
6b98fbacf7 Merge pull request #19665 from eileencodes/fix-parse_query-method-signature
Fix method signature of `parse_query` to match rack
2015-04-06 08:34:20 -04:00
eileencodes
0eef12c0b3 Fix method signature of parse_query to match rack
Recently rack was changed to have a second argument on the `parse_query`
method (in rack/rack#781). Rails relies on this and it's `parse_query`
method was complaining about missing the second argument. I changed the
arguments to `*` so we don't have this issue in the future.
2015-04-06 08:30:32 -04:00
Michael Josephson
e39f11f50a fix missing "if" in API docs for ActionController::Parameters#permit 2015-04-06 13:22:07 +01:00
David Heinemeier Hansson
ca4417d333 Merge pull request #19377 from sb8244/issue-19036
when a template is missing for the default render, do head no_content instead
2015-04-06 12:40:02 +02:00
Yves Senn
51eacc71c7 Merge pull request #19652 from vngrs/pluralize_foreign_key_table_name_bug
use singular table name if pluralize_table_names is setted as false whil...
2015-04-06 10:42:44 +02:00
Mehmet Emin İNAÇ
8c1180731f use singular table name if pluralize_table_names is setted as false while creating foreign key
test case for use singular table name if pluralize_table_names is setted as false while creating foreign key

refactor references foreign key addition tests

use singular table name while removing foreign key

merge foreign key singular table name methods

remove unnecessary drop table from test
2015-04-06 11:10:24 +03:00
Matthew Draper
e527688d19 Merge pull request #19662 from yui-knk/fix/bind
[ci skip] Remove Extensions to `Proc` section
2015-04-06 17:38:37 +09:30
yui-knk
1917719f00 [ci skip] Remove Extensions to Proc chapter section
`Proc#bind` is removed with 4.1 release
2015-04-06 08:37:27 +09:00
Karol Galanciak
a813fa09a8 Accept lambda as child_index option in #fields_for method 2015-04-05 21:51:19 +02:00
Stephen Bussey
0de4a23d1c head no_content when there is no template or action performed 2015-04-05 15:46:50 -04:00
Yves Senn
9040699aed Merge pull request #19657 from smadeja/guides-update
Update command_tasks source code
2015-04-05 17:26:42 +02:00
Yves Senn
70b7e281de fix typo in deprecation message. [Robin Dupret] 2015-04-05 17:23:36 +02:00
Szymon Madeja
1fda385cdf Update command_tasks source code 2015-04-05 17:10:40 +02:00
Robin Dupret
9cc41c36f7 Fix a few typos [ci skip] 2015-04-05 15:58:43 +02:00
Yves Senn
0eab204c0e Merge pull request #19644 from y-yagi/auto_discovery_link_tag_doc
correct output of auto_discovery_link_tag [ci skip]
2015-04-05 10:55:13 +02:00
Arthur Nogueira Neves
56e0723c3d Merge pull request #19650 from vngrs/fix_for_i18n_documentation
change REQUEST_URI to PATH_INFO
2015-04-05 00:42:44 -04:00
Mehmet Emin İNAÇ
75c32edd9d change REQUEST_URI to PATH_INFO
request.env['REQUEST_URI'] returns full URI of the resource
request.env['PATH_INFO'] returns only path of the resource
2015-04-04 21:16:58 +03:00
Matthew Draper
07875e2aa6 Merge pull request #19649 from aprescott/allow-array-defaults
Allow an array to be a default translation value.
2015-04-05 02:55:00 +09:30
Adam Prescott
6f3c65f630 Allow an array to be a default translation value.
4.2.1 introduced a change to the way `translate`/`t` works with an
option of `default: [[]]`. In 4.2.0, this would give a default value of
`[]`, but in 4.2.1, it leads to a missing translation.

`default: [[]]` is again allowed for cases where a default of `[]` is
needed.

This addresses GitHub issue 19640.
2015-04-04 12:46:45 -04:00
eileencodes
191facc857 Don't invoke sql_runtime if logger is not set to info
`sql_runtime` was getting invoked even when the logger was set to fatal.
This ensures that does not happen by checking that the logger is set to
info level before logging the view runtime.

This reduces the number of times `sql_runtime` is called for integration
tests with a fatal logger from 6 to 2.
2015-04-04 09:21:18 -04:00
Shintaro Kojima
e646d3bf57 Fix a regression introduced by removing unnecessary db call when replacing
When replacing a has_many association with the same one, there is nothing to do with database but a setter method should still return the substituted value for backward compatibility.
2015-04-04 12:48:36 +00:00
yuuji.yaginuma
e2d9e85368 correct output of auto_discovery_link_tag [ci skip] 2015-04-04 07:37:23 +09:00
Kasper Timm Hansen
5abadf1613 Merge pull request #19636 from davydovanton/docs-update-link-to-attributes
[skip ci] Update information about #link_to attributes
2015-04-04 00:31:46 +02:00
Anton Davydov
dd2be69ce7 [skip ci] Update information about #link_to attributes 2015-04-04 00:18:40 +03:00
Matthew Draper
faa37c7652 Merge pull request #19429 from mxhold/print_bundle_install_output_line_by_line
Print `bundle install` output in `rails new` as soon as it's available
2015-04-03 23:07:55 +10:30
Matthew Draper
ca14f11b07 Merge pull request #19625 from strzibny/fix-test-rails-git-layout
Do not depend on Rails git repository layout in ActiveSupport tests
2015-04-03 22:40:24 +10:30
Matthew Draper
90acb66c3d Merge pull request #19627 from koenpunt/patch-1
remove duplicates
2015-04-03 22:05:42 +10:30
Iain Beeston
d2876141d0 Raise ArgumentError if an unrecognised callback is skipped
At present, if you skip a callback that hasn't been defined,
activesupport callbacks silently does nothing. However, it's easy to
mistype the name of a callback and mistakenly think that it's being
skipped, when it is not.

This problem even exists in the current test suite.
CallbacksTest::SkipCallbacksTest#test_skip_person attempts to skip
callbacks that were never set up.

This PR changes `skip_callback` to raise an `ArgumentError` if the
specified callback cannot be found.
2015-04-03 09:37:19 +01:00
Koen Punt
9452dc9c0a remove duplicates 2015-04-03 00:00:30 +02:00
Josef Stribny
097ac2045a Do not depend on Rails git repository layout in ActiveSupport tests 2015-04-02 17:09:24 +02:00
Jeremy Kemper
a05f3e5f96 Merge pull request #19616 from brainopia/speed_up_gsub
Prefer string patterns for gsub
2015-04-01 17:45:36 -07:00
brainopia
58d75fd811 Freeze static arguments for gsub 2015-04-02 02:15:07 +03:00
brainopia
cdac52e124 Prefer string patterns for gsub
https://github.com/ruby/ruby/pull/579 - there is a new optimization
since ruby 2.2

Previously regexp patterns were faster (since a string was converted to
regexp underneath anyway). But now string patterns are faster and
better reflect the purpose.

  Benchmark.ips do |bm|
    bm.report('regexp') { 'this is ::a random string'.gsub(/::/, '/') }
    bm.report('string') { 'this is ::a random string'.gsub('::', '/') }
    bm.compare!
  end
  # string: 753724.4 i/s
  # regexp: 501443.1 i/s - 1.50x slower
2015-04-02 02:07:45 +03:00
Carlos Antonio da Silva
4ba1376c60 Remove old mri platform entries from our Gemfile
Since we now only support Ruby 2.2+, we can safely remove the old mri
entries from the Gemfile.

This also allows us not to lock to a specific bundler version, since
:mri_22 was defined only on 1.7.11.

Closes #19611.
2015-04-01 17:09:58 -03:00
Abdelkader Boudih
c91581ffee Merge pull request #19610 from yui-knk/fix/suppress
[ci skip] Replace `reraised` with `not captured`
2015-04-01 16:46:41 +01:00
Abdelkader Boudih
f0590c4c7a Merge pull request #19609 from davydovanton/docs-add-target-blank-info
[skip ci] Add information about #link_to target option
2015-04-01 16:40:49 +01:00
Anton Davydov
fd9d7312a3 [skip ci] Add information about #link_to target option 2015-04-01 18:32:55 +03:00
yui-knk
a21a8192aa [ci skip] Replace reraised with not captured 2015-04-02 00:26:18 +09:00
Rafael Mendonça França
dd39c96f59 Merge pull request #19607 from rousisk/docs_sql_execute_correction
[ci skip] fix guides example on arbitrary SQL execution
2015-04-01 11:10:17 -03:00
Konstantinos Rousis
8f092302aa [ci skip] fix guides example on arbitrary SQL execution 2015-04-01 16:03:41 +02:00
yui-knk
0f26977d09 [ci skip] Remove unnecessary lines 2015-04-01 20:02:56 +09:00
yui-knk
66bf962a7a [ci skip] Add : 2015-04-01 19:59:54 +09:00
Rafael Mendonça França
69881fb03b Merge pull request #19606 from yui-knk/fix/query_md
[ci skip] Fix `:having` option with `having` method
2015-04-01 01:52:58 -03:00
yui-knk
8f73c3ff61 [ci skip] Fix :having option with having method 2015-04-01 13:45:56 +09:00
Rafael Mendonça França
a6ecc06ece Merge pull request #19605 from 1337807/patch-1
Update routing.md
2015-04-01 00:37:31 -03:00
Jonan Scheffler
21a2d9a987 Update routing.md
This adds instructions for routing to rack applications with mount instead of match.

I just spent an unreasonable amount of time staring at this, hopefully the next person will save some time. It's possible that the docs should simply advise people to use mount and leave out the match method but I don't know enough about the differences in the two approaches to assert that definitively.
2015-04-01 00:37:23 -03:00
Rafael Mendonça França
e3e28e4dab Merge pull request #19604 from aaronjensen/speed-up-time-coercion
Only coerce time when comparing if necessary
2015-04-01 00:31:53 -03:00