aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | | | Merge pull request #23669 from maclover7/internal-routesRafael França2016-02-226-10/+36
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | Add `internal` attribute to routes
| * | | | | | | Add `internal` attribute to routesJon Moss2016-02-226-10/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is meant to provide a way for Action Cable, Sprockets, and possibly other Rack applications to mark themselves as internal, and to exclude themselves from the routing inspector, and thus `rails routes` / `rake routes`. I think this is the only way to have mounted Rack apps be marked as internal, within AD/Journey. Another option would be to create an array of regexes for internal apps, and then to iterate over that everytime a request comes through. Also, I only had the first `add_route` method set `internal`'s default to false, to avoid littering it all over the codebase.
* | | | | | | | Merge pull request #23668 from maclover7/cable-docsRafael França2016-02-2216-70/+67
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Full Action Cable documentation read through
| * | | | | | | | Full Action Cable documentation read throughJon Moss2016-02-1716-70/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This PR checks all active Action Cable documentation for typos and other fixes. It aims to make sure that when Rails 5 is released, that the Action Cable docs are up to snuff with the other documentation included with Rails. [ci skip]
* | | | | | | | | Merge pull request #23600 from maclover7/actioncable-workRafael França2016-02-228-0/+64
|\ \ \ \ \ \ \ \ \ | |_|/ / / / / / / |/| | | | | | | | Assorted Railties generators work
| * | | | | | | | Add notes for future selvesJon Moss2016-02-222-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Once RubyGems 2.5.0 is required, then the duplicated files can be removed, and symlinks can be used instead. [ci skip]
| * | | | | | | | Generate ApplicationCable files if they do not already existJon Moss2016-02-224-0/+38
| | | | | | | | |
| * | | | | | | | Generate ApplicationRecord if it does not already existJon Moss2016-02-223-0/+19
| | | | | | | | |
| * | | | | | | | Generate `config/cable.yml` in `rails:update` commandJon Moss2016-02-221-0/+5
|/ / / / / / / /
* | | | | | | | Merge pull request #23816 from rails/params_parser_apiRafael França2016-02-225-9/+47
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Make sure the parameter parsers register API work with overidden mime types.
| * | | | | | | | Make sure we unregister the mime type before registeringRafael Mendonça França2016-02-221-10/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also make sure we don't change the global state of our test suite.
| * | | | | | | | Transform the mime object to symbol when registering the parsersRafael Mendonça França2016-02-223-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will keep our current API working without having the users to change their codebases.
| * | | | | | | | Use symbol of mime type instead of object to get correct parserMehmet Emin İNAÇ2016-02-224-6/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After registering new `:json` mime type `parsers.fetch` can't find the mime type because new mime type is not equal to old one. Using symbol of the mime type as key on parsers hash solves the problem. Closes #23766
* | | | | | | | | make sure `rake test` respects TESTOPTSAaron Patterson2016-02-222-1/+15
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We should be able to pass options to minitest via TESTOPTS environment variable
* | | | | | | | We are calling `to_s` in the method so we can call downcase nowRafael Mendonça França2016-02-221-3/+3
| | | | | | | |
* | | | | | | | Make per form token work when method is not providedRafael Mendonça França2016-02-222-3/+18
| |_|/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When `button_to 'Botton', url` form was being used the per form token was not correct because the method that is was being used to generate it was an empty string.
* | | | | | | Do not pass more options that are needed.Rafael Mendonça França2016-02-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We only need action and method so pass them explicitly instead of merging the hash with HTML options.
* | | | | | | Merge pull request #23752 from vipulnsward/23524-fix-button_to_deleteRafael Mendonça França2016-02-222-49/+61
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Fixed passing of delete method on button_to tag, creating wrong form csrf token
| * | | | | | | Refactored Request Forgery CSRF PerFormTokensController tests and DRY'ed ↵Vipul A M2016-02-222-71/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | them up.
| * | | | | | | Fixed passing of delete method on button_to tag, creating wrong form csrf tokenVipul A M2016-02-212-2/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #23524
* | | | | | | | Merge pull request #23521 from kamipo/fix_assert_in_delta_failureRafael França2016-02-221-3/+8
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Fix `assert_in_delta` test failure
| * | | | | | | | Fix `assert_in_delta` test failureRyuta Kamizono2016-02-061-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `assert_in_delta` in `timestamp_test.rb` causes an intermittent test failure. It looks like that caused by subseconds truncation in MySQL 5.5. Example: ``` 1) Failure: TimestampTest#test_touching_many_attributes_updates_them [/home/travis/build/rails/rails/activerecord/test/cases/timestamp_test.rb:125]: Expected |2016-02-06 09:22:10 +0000 - 2016-02-06 09:22:09 UTC| (1.000837185) to be <= 1. ```
* | | | | | | | | Merge pull request #22748 from Azzurrio/masterMatthew Draper2016-02-222-1/+23
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Fix NoMethodError preparable for Arel::Visitors::PostgreSQL
| * | | | | | | | | Fix NoMethodError preparable for Arel::Visitors in case prepared statements ↵Azzurrio2016-02-222-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | is falsy
* | | | | | | | | | Merge pull request #23751 from chezou/add-test-case-order-by-fieldAndrew White2016-02-221-0/+6
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Add test cases about MySQL ORDER BY FIELD()
| * | | | | | | | | | Add assertions order by field with empty dataMichiaki Ariga2016-02-181-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add assertions to MySQL `ORDER BY FIELD()` with empty data. These tests examine to sanitize `ORDER BY FIELD()` with empty data appropriately. ```ruby Tag.order(['field(id, ?)', []]).to_sql # => SELECT "tags".* FROM "tags" ORDER BY field(id, NULL) Tag.order(['field(id, ?)', nil]).to_sql # => SELECT "tags".* FROM "tags" ORDER BY field(id, NULL) ```
* | | | | | | | | | | Merge pull request #23808 from gfvcastro/typographical-errorप्रथमेश Sonpatki2016-02-221-1/+1
|\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Fix typographical error
| * | | | | | | | | | | Fix typographical errorGustavo Villa2016-02-221-1/+1
|/ / / / / / / / / / /
* | | | | | | | | | | Merge pull request #23769 from kamipo/remove_alias_exec_without_stmt_exec_querySantiago Pastorino2016-02-211-2/+0
|\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Remove `alias exec_without_stmt exec_query`
| * | | | | | | | | | | Remove `alias exec_without_stmt exec_query`Ryuta Kamizono2016-02-191-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This alias was for compatibility with legacy mysql adapter. But the return value of both methods is already inconsistent. `exec_query` returns `ActiveRecord::Result` instance. But `exec_without_stmt` returns `[result_set, affected_rows]` https://github.com/rails/rails/blob/v4.2.5.1/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb#L335-L364 Legacy mysql adapter was already removed in Rails 5.0. I think we can remove this inconsistent alias.
* | | | | | | | | | | | Merge pull request #23682 from ShikChen/fast_strxorSantiago Pastorino2016-02-211-1/+2
|\ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | Improve the performance of string xor operation
| * | | | | | | | | | | | Improve the performance of string xor operationshik2016-02-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use `each_byte` instead of `bytes` to speed up string xor operation and reduce object allocations. Inspired by commit 02c3867882d6d23b10df262a6db5f937ca69fb53. ``` ruby require 'benchmark/ips' require 'allocation_tracer' a = 32.times.map { rand(256) }.pack('C*') b = 32.times.map { rand(256) }.pack('C*') def xor_byte_strings1(s1, s2) s1.bytes.zip(s2.bytes).map { |(c1,c2)| c1 ^ c2 }.pack('c*') end def xor_byte_strings2(s1, s2) s2_bytes = s2.bytes s1.bytes.map.with_index { |c1, i| c1 ^ s2_bytes[i] }.pack('c*') end def xor_byte_strings3(s1, s2) s2_bytes = s2.bytes s1.each_byte.with_index { |c1, i| s2_bytes[i] ^= c1 } s2_bytes.pack('C*') end fail if xor_byte_strings1(a, b) != xor_byte_strings2(a, b) fail if xor_byte_strings1(a, b) != xor_byte_strings3(a, b) Benchmark.ips do |x| x.report('xor_byte_strings1') { xor_byte_strings1(a, b) } x.report('xor_byte_strings2') { xor_byte_strings2(a, b) } x.report('xor_byte_strings3') { xor_byte_strings3(a, b) } x.compare! end Tracer = ObjectSpace::AllocationTracer Tracer.setup(%i{type}) p xor_byte_strings1: Tracer.trace { xor_byte_strings1(a, b) } p xor_byte_strings2: Tracer.trace { xor_byte_strings2(a, b) } p xor_byte_strings3: Tracer.trace { xor_byte_strings3(a, b) } ``` ``` Warming up -------------------------------------- xor_byte_strings1 10.668k i/100ms xor_byte_strings2 11.814k i/100ms xor_byte_strings3 13.139k i/100ms Calculating ------------------------------------- xor_byte_strings1 116.667k (± 3.1%) i/s - 586.740k xor_byte_strings2 129.932k (± 4.3%) i/s - 649.770k xor_byte_strings3 142.506k (± 4.2%) i/s - 722.645k Comparison: xor_byte_strings3: 142506.3 i/s xor_byte_strings2: 129932.4 i/s - 1.10x slower xor_byte_strings1: 116666.8 i/s - 1.22x slower {:xor_byte_strings1=>{[:T_ARRAY]=>[38, 0, 0, 0, 0, 0], [:T_STRING]=>[2, 0, 0, 0, 0, 0]}} {:xor_byte_strings2=>{[:T_ARRAY]=>[3, 0, 0, 0, 0, 0], [:T_DATA]=>[1, 0, 0, 0, 0, 0], [:T_IMEMO]=>[2, 0, 0, 0, 0, 0], [:T_STRING]=>[2, 0, 0, 0, 0, 0]}} {:xor_byte_strings3=>{[:T_ARRAY]=>[1, 0, 0, 0, 0, 0], [:T_DATA]=>[1, 0, 0, 0, 0, 0], [:T_IMEMO]=>[2, 0, 0, 0, 0, 0], [:T_STRING]=>[2, 0, 0, 0, 0, 0]}} ```
* | | | | | | | | | | | | Merge pull request #23776 from chi6rag/masterSantiago Pastorino2016-02-211-0/+4
|\ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding test to verify the last week when the year is leap
| * | | | | | | | | | | | | Adding test to verify the last week when the year is leapChirag Aggarwal2016-02-201-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixing failing specification for verifying the last week when the year is leap
* | | | | | | | | | | | | | Merge pull request #23803 from kamipo/reduce_attribute_to_sSantiago Pastorino2016-02-211-6/+5
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reduce `attribute.to_s`
| * | | | | | | | | | | | | | Reduce `attribute.to_s`Ryuta Kamizono2016-02-221-6/+5
| | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | Merge pull request #23743 from maclover7/rm-unused-parameterSantiago Pastorino2016-02-211-2/+2
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove unused parameter from method
| * | | | | | | | | | | | | | | Remove unused parameter from methodJon Moss2016-02-171-2/+2
| | |_|_|_|_|_|_|_|_|_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `attribute` parameter is not used inside the `normalize_detail` method. This does not need to go through a deprecation cycle, since the method is private.
* | | | | | | | | | | | | | | Merge pull request #23805 from ianfleeton/validates-length-of-virtualSantiago Pastorino2016-02-211-1/+1
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Match test name to test (typo)
| * | | | | | | | | | | | | | | Match test name to test (typo)Ian Fleeton2016-02-211-1/+1
| | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | Merge pull request #23806 from sgringwe/patch-1Santiago Pastorino2016-02-211-0/+3
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / / / / / |/| | | | | | | | | | | | | | | Add a note about downcasing submit tag
| * | | | | | | | | | | | | | | Add a note about downcasing submit tagScott Ringwelski2016-02-211-0/+3
|/ / / / / / / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a notable change since this will cause confusing test failures for tests relying on the old naming scheme.
* | | | | | | | | | | | | | | Merge pull request #23785 from eval/correct-types-examplesVipul A M2016-02-222-108/+108
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Show correct return types for examples
| * | | | | | | | | | | | | | | Show correct return types for examples [ci skip]Gert Goet2016-02-202-108/+108
| | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | [ci skip] Document collection caching better.Kasper Timm Hansen2016-02-211-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why are we here? Where did we come from? Where are we going... in 5 minutes? These questions are not answered in this documentation. Instead collection caching is better clarified. How it works, how it can share caches with individual templates.
* | | | | | | | | | | | | | | | [ci skip] Clarify collection caching went EXPLICIT.Kasper Timm Hansen2016-02-211-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Yo dawg, we so explicit if we were a music track, yo' iPhone's Music app would put an E next to it. *drops mic*
* | | | | | | | | | | | | | | | [ci skip] Mention testing fore-runners.Kasper Timm Hansen2016-02-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Get it? ( ͡° ͜ʖ ͡°)
* | | | | | | | | | | | | | | | Merge pull request #23799 from y-yagi/use_method_provided_by_minitestKasper Timm Hansen2016-02-211-7/+1
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | use method provided by minitest
| * | | | | | | | | | | | | | | | use method provided by minitestyuuji.yaginuma2016-02-211-7/+1
| | |_|_|_|_|_|_|_|_|/ / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The process of converting `Test` to `String` is already defined in minitest. I think it is better to use that for the consistency of output content. ref: https://github.com/seattlerb/minitest/blob/master/lib/minitest/test.rb#L261..L267
* | | | | | | | | | | | | | | | Merge pull request #23801 from chashmeetsingh/patch-2प्रथमेश Sonpatki2016-02-211-1/+1
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed typo