Commit Graph

59914 Commits

Author SHA1 Message Date
Guillermo Iguaran
f6df3d9a7a Merge pull request #26862 from headius/lazy_load_blade_for_tests
Lazy-load blade for actioncable tests; no blade on JRuby.
2016-10-21 17:41:55 -05:00
Charles Oliver Nutter
51de32b2ec Lazy-load blade for actioncable tests; no blade on JRuby. 2016-10-21 17:19:44 -05:00
Kasper Timm Hansen
5dce39e829 Merge pull request #26860 from headius/soft_ordering_in_yaml_dump
Soften this test since YAML.dump may produce keys in other orders.
2016-10-22 00:02:01 +02:00
Aaron Patterson
b6f935bbf9
Use on_load to trigger commandline processing code
We need to use on_load so that plugins will get the same functionality
2016-10-21 14:44:17 -07:00
Charles Oliver Nutter
fe09e7bd71 Soften this test since YAML.dump may produce keys in other orders. 2016-10-21 16:27:06 -05:00
Aaron Patterson
797f1dd63c
Prevent the test framework from being loaded in production mode
The test framework should not be autoloaded in production mode.  Before
this commit, the testing railtie would extend AS::TestCase.  This caused
AS::TestCase to be preloaded regardless of the environment in which we
were running.

This commit just moves the code that adds line filtering support in to
the test command where we actually execute the test runner.  That allows
us to maintain the line runner feature but only load the minimal amount
of code we need.
2016-10-21 13:10:26 -07:00
Aaron Patterson
54a5b99a00 Merge pull request #26859 from headius/mask_use_of_rubyvm_on_jruby
Skip test that depends on RubyVM when it is not available (JRuby).
2016-10-21 13:10:00 -07:00
Charles Oliver Nutter
9531e69f99 Skip test that depends on RubyVM when it is not available (JRuby). 2016-10-21 14:36:51 -05:00
Rafael Mendonça França
e16a5fb508
Revert "Undefine assings in IntegrationTest"
This reverts commit 5dde413e1d14c42eb87071db20d075a7b962cb01.

Reason: The gem defines it so we don't need to remove
2016-10-21 16:14:39 -03:00
Rafael França
2b584f165b Merge pull request #26819 from lastgabs/add-examples-active-job-test-helper
Add examples of queue_adapter and perform_enqueued jobs to API Docs.
2016-10-21 13:56:39 -03:00
Aaron Patterson
0aed0bbb29 Merge pull request #26050 from bogdanvlviv/optimistic_locking
Fixed: Optimistic locking does not work correctly
2016-10-21 09:08:38 -07:00
bogdanvlviv
a60a20bb7f Added ability update locking_column value 2016-10-21 19:06:02 +03:00
bogdanvlviv
22a822e581 Fixed: Optimistic locking does not work well with null in the database 2016-10-21 19:06:02 +03:00
Gabi Stefanini
0d454d0806 Add examples of queue_adapter and perform_enqueued jobs to API Docs. 2016-10-21 11:59:01 -04:00
Aaron Patterson
4393406a8a Merge pull request #26855 from headius/explicit_order_callback_args
Additional fix for argument-splat ordering differences.
2016-10-21 08:20:18 -07:00
Aaron Patterson
0a3595f64d Merge pull request #26854 from headius/explicit_order_callback_args
Explicitly unpack the expanded args to avoid execution order diff.
2016-10-21 08:17:21 -07:00
Charles Oliver Nutter
2674392058 Additional fix for argument-splat ordering differences.
See #26854
2016-10-21 10:16:58 -05:00
Charles Oliver Nutter
5f382d41c3 Explicitly unpack the expanded args to avoid execution order diff.
In https://bugs.ruby-lang.org/issues/12860 I argue that MRI's
execution order here is incorrect. The splatting of the 'c' args
should happen before the shift, but it happens after. On JRuby, it
behaves the way you would expect, leading to the 'c' args splat
still containing the block and producing an error like "cannot
convert proc to symbol" when the send attempts to coerce
it.

This patch makes the unpacking order explicit with a multi-assign,
which behaves properly on all implementations I tested.
2016-10-21 09:33:25 -05:00
Guillermo Iguaran
a08ef99d5f Merge pull request #26853 from zegomesjf/feature/skip_active_record
don't create db directory when skip active_record
2016-10-21 09:15:20 -05:00
José Gomes Júnior
1b7263143a don't create db directory when skip active_record 2016-10-21 10:51:31 -02:00
Andrew White
f2c6db41ba Merge pull request #26839 from renuo/fix-missing-nsec-transfer
Fix copy_time_to: Copy nsec instead of usec
2016-10-21 07:03:32 +01:00
Yves Senn
dce4751a74 doc, hide non-public methods form the api docs. [ci skip]
This is a follow up to #25681, specifically this comment:
https://github.com/rails/rails/pull/25681#issuecomment-238294002

The way the thread local variable is stored is an implementation detail
and subject to change. It makes no sense to only generate a reader or
writer as you'd have to know where to read from or where it writes to.
2016-10-20 21:21:55 +02:00
Yves Senn
dba9ce8ec8 guides, include note about modifiers when using the CLI.
[ci skip]

This was pointed out on
https://github.com/rails/rails/issues/15583#issuecomment-239212831

The comment was lost in the changes made by
fcd0ac066e0959a9f4fa4459a27e041abe8eb52a and
3e1373a773085d5f19cb6a466ab2736cc1ca2713
2016-10-20 20:34:46 +02:00
Yves Senn
fb2f8d2b75 remove trailing whitespace [ci skip] 2016-10-20 20:32:24 +02:00
Rafael França
184cc703a2 Merge pull request #26846 from brunofacca/patch-1
[ci skip] Fix return values of Hash Extensions examples
2016-10-20 14:42:32 -03:00
Bruno Facca
85dd85fe01 [ci skip] Fix return values of Hash Extensions examples
The hashes returned in some examples of the following sections had items in a different order than their receivers. That may mislead readers into believing those methods will not preserve element order.

Extensions to Hash/Working with Keys/transform_keys and transform_keys!
Extensions to Hash/Working with Keys/stringify_keys and stringify_keys!
Extensions to Hash/Working with Keys/symbolize_keys and symbolize_keys!
Extensions to Hash/Slicing
2016-10-20 15:38:49 -02:00
Vijay Dev
5741e87eea Merge branch 'master' of github.com:rails/docrails 2016-10-20 17:28:48 +00:00
Aaron Patterson
1345511081
Use old typecasting method if no type casted binds are passed in
Query cache doesn't type cast bind parameters since it isn't
actually querying the database, so it can't pass those values in.  Type
casting in the query cache method would cause the values to be type cast
twice in the case that there is a cache miss (since the methods it calls
will type cast *again*).  If logging is disabled, then adding the type
cast code to the query cache method will needlessly typecast the values
(since the only reason those values are type cast is for display in the
logs).

Fixes #26828.
2016-10-20 09:27:14 -07:00
Rafael Mendonça França
b10227728b
Merge pull request #26830 from headius/mask_forking_fsevent_test_on_jruby
Mask forking filesystem event on JRuby.
2016-10-20 10:42:50 -03:00
Josua Schmid
fc72d6815a
Fix copy_time_to: Copy nsec instead of usec
`copy_time_to` is a helper function for date and time calculations.
It's being used by `prev_week`, `next_week` and `prev_weekday` to keep
the time fraction when jumping around between days.

Previously the nanoseconds part was lost during the operation. This
lead to problems in practice if you were using the `end_of_day`
calculation. Resulting in the time fraction of `end_of_day` not being
the same as next week's `end_of_day`.

With this fix `copy_time_to` doesn't forget the `nsec` digits.
2016-10-20 10:49:59 +02:00
Aaron Patterson
af45bbc3c9
render_bind should be private 2016-10-19 17:49:36 -07:00
Aaron Patterson
cd5e4188ee
Merge pull request #26829 from headius/wait_for_events_in_listen_tests
Wait for file events to propagated for slower Listen backends.
2016-10-19 15:00:38 -07:00
Jon Moss
278ee089e6 Merge pull request #26825 from orhantoy/fix-doc-code-indentation
[ci skip] Fix indentation of code examples
2016-10-19 16:35:20 -04:00
Orhan Toy
2448fbabf4 Fix indentation of code examples
This commit fixes the generated HTML of the two code examples.
2016-10-19 19:38:21 +02:00
प्रथमेश Sonpatki
125ecfbbff Merge pull request #26821 from y-yagi/update_doc_about_change_column_default
update doc about `change_column_default` [ci skip]
2016-10-19 13:51:07 +05:30
yuuji.yaginuma
2aab983fff update doc about change_column_default [ci skip]
Follow up to #20018.
2016-10-19 17:16:41 +09:00
Jon Moss
8e76f6959e Merge pull request #26809 from alexcameron89/contributing_guide_typo
[ci skip] Fix typo in Guides: Contributing
2016-10-17 17:43:53 -04:00
Alex Kitchens
f6cc4f5648 [ci skip] Fix typo in Guides: Contributing 2016-10-17 16:31:01 -05:00
प्रथमेश Sonpatki
6aa3784002 /s/integrations/integration [ci skip] (#26801) 2016-10-16 20:31:28 +02:00
Guillermo Iguaran
d21b0c9079 Merge pull request #26800 from prathamesh-sonpatki/bump-bundler
Bump bundler version in the before_install hook of travis
2016-10-16 12:49:25 -05:00
Prathamesh Sonpatki
bb93276b8d
Bump bundler version in the before_install hook of travis
- We were running into issues with old bundler versions on 4.2
  builds. So we bumped the bundler version on 4-2-stable branch in
  https://github.com/rails/rails/pull/26592.
- This commit applies same change to master as per discussion in
  https://github.com/rails/rails/pull/26592#issuecomment-254026755.
2016-10-16 19:07:31 +02:00
Eileen M. Uchitelle
28ce091f82 Merge pull request #26786 from codeodor/patch-1
Allow any key in Renderer environment hash
2016-10-15 10:53:43 -04:00
Rafael Mendonça França
10781f30a0
Copy-edit the documentation
[ci skip]
2016-10-15 11:13:13 -03:00
Rafael França
da840cd810 Merge pull request #26793 from zachaysan/master
Make `process` a non-private method and update documentation.
2016-10-15 11:00:42 -03:00
Eileen M. Uchitelle
d80611d320 Merge pull request #26598 from rutaka-n/raise_record_not_found_with_correct_params
initialize errors with name of class and other params
2016-10-15 09:35:28 -04:00
rmarone
be6990bf01 Pull request for ticket 26769 (#26770)
* Clarify the default behavior of log_formatter

Updates language to remove reference to production.rb and fix quoting
2016-10-15 09:20:41 -04:00
Zach Aysan
1f979184ef Make process a non-private method and update documentation. 2016-10-15 08:52:07 -04:00
Sammy Larbi
6fccd7b629 Allow any key in Renderer environment hash
When rendering arbitrary templates, it is helpful to not overwrite `env` keys with nil if they don't match any found in the `RACK_KEY_TRANSLATION`

This allows the developer to set the environment to exactly what is needed for rendering.
2016-10-15 07:03:33 -05:00
Godfrey Chan
0bf90faddb Merge pull request #26792 from rails/benchmark-template
Introduce a benchmark template
2016-10-15 12:36:07 +02:00
Godfrey Chan
f2f9b88685 Introduce a benchmark template [ci skip]
This replaces boilerplate in the “benchmark your code” section of the
contributors’ guide with an executable template. I also amended the text
to encourage best practices and codified it in the template.

For now this is only good for relatively self-contained changes that can
be inlined into a simple script. In the future, this can be expanded to
cover how to measure the difference between two commits.

The output looks like this:

```
==================================== Empty =====================================

Warming up --------------------------------------
              blank?   225.963k i/100ms
         fast_blank?   238.147k i/100ms
Calculating -------------------------------------
              blank?      8.825M (± 6.4%) i/s -     44.063M in   5.014824s
         fast_blank?      9.311M (± 6.3%) i/s -     46.439M in   5.009153s

Comparison:
         fast_blank?:  9310694.8 i/s
              blank?:  8824801.7 i/s - same-ish: difference falls within error


================================= Single Space =================================

Warming up --------------------------------------
              blank?    56.581k i/100ms
         fast_blank?   232.774k i/100ms
Calculating -------------------------------------
              blank?    813.985k (±16.7%) i/s -      4.017M in   5.076576s
         fast_blank?      9.547M (± 5.2%) i/s -     47.719M in   5.013204s

Comparison:
         fast_blank?:  9547414.0 i/s
              blank?:   813985.0 i/s - 11.73x  slower


================================== Two Spaces ==================================

Warming up --------------------------------------
              blank?    58.265k i/100ms
         fast_blank?   244.056k i/100ms
Calculating -------------------------------------
              blank?    823.343k (±16.2%) i/s -      4.020M in   5.014213s
         fast_blank?      9.484M (± 4.9%) i/s -     47.347M in   5.005339s

Comparison:
         fast_blank?:  9484021.6 i/s
              blank?:   823343.1 i/s - 11.52x  slower


=============================== Mixed Whitspaces ===============================

Warming up --------------------------------------
              blank?    53.919k i/100ms
         fast_blank?   237.103k i/100ms
Calculating -------------------------------------
              blank?    763.435k (±16.8%) i/s -      3.720M in   5.018029s
         fast_blank?      9.672M (± 5.8%) i/s -     48.369M in   5.019356s

Comparison:
         fast_blank?:  9672467.2 i/s
              blank?:   763435.4 i/s - 12.67x  slower


=============================== Very Long String ===============================

Warming up --------------------------------------
              blank?    34.037k i/100ms
         fast_blank?   240.366k i/100ms
Calculating -------------------------------------
              blank?    409.731k (± 8.9%) i/s -      2.042M in   5.028235s
         fast_blank?      9.794M (± 4.3%) i/s -     49.035M in   5.016328s

Comparison:
         fast_blank?:  9794225.2 i/s
              blank?:   409731.4 i/s - 23.90x  slower
```
2016-10-15 12:34:46 +02:00