Commit Graph

56387 Commits

Author SHA1 Message Date
David Heinemeier Hansson
074ff5ce14 Merge pull request #23583 from brchristian/penultimate
Array.second_to_last and Array.third_to_last access methods
2016-02-10 20:45:12 +01:00
Brian Christian
eaa1efe7d0 include activerecord and activesupport CHANGELOG entries 2016-02-10 10:31:44 -08:00
Brian Christian
e8aeda2ab3 rename to 'second_to_last' and 'third_to_last' 2016-02-10 10:10:38 -08:00
David Heinemeier Hansson
688996da7b Merge pull request #21671 from kaspth/integration-request-encoding-helpers
Add `as` to encode a request as a specific mime type.
2016-02-10 17:46:14 +01:00
David Heinemeier Hansson
b07970883d Merge pull request #22772 from gsamokovarov/nack-template-error
Fix edge case with ActionView::Template::Error reraise
2016-02-10 17:41:34 +01:00
David Heinemeier Hansson
437a7a406c Merge pull request #23512 from y-yagi/set_association_name_to_fixture
set association name to generated fixtures if attribute is reference
2016-02-10 17:23:30 +01:00
Vipul A M
31778a34a8 Merge pull request #23587 from wallclockbuilder/patch-1
Fix tiny grammar.
2016-02-10 11:07:42 +05:30
Mawueli Kofi Adzoe
f2fcd3a000 Fix tiny grammar. 2016-02-09 22:35:40 -07:00
प्रथमेश Sonpatki
21547fc680 Merge pull request #23586 from jhcole/master
Fix typo
2016-02-10 09:58:53 +05:30
John Cole
344ddcbc3e Fix typo 2016-02-09 23:07:38 -05:00
Jon Moss
ce33443d72 Merge pull request #23584 from mgm702/fix_grammar_errors_in_security_and_migrations_docs_master
Fix grammar errors in security and migrations docs master [ci skip]
2016-02-09 20:01:22 -05:00
Matt Michnal
767f168772 Fixed grammatical errors in rails docs [ci skip]
Fixed errors in rails migrations docs [ci skip]

Fixed errors in rails security docs [ci skip]
2016-02-09 17:57:16 -07:00
Xavier Noria
bd69718124 prevent apps in the railties test suite from running the evented monitor 2016-02-10 01:32:17 +01:00
Brian Christian
c74045cf07 allow Array.penultimate and Array.antepenultiate access methods 2016-02-09 16:02:08 -08:00
Xavier Noria
00a5eb6aeb include spring-watcher-listen in the Gemfile of new applications 2016-02-10 00:45:19 +01:00
Xavier Noria
de6ad5665d enables the evented monitor in new applications 2016-02-10 00:28:50 +01:00
Aaron Patterson
b5eb2423b6 log_process_action will return an array, so use empty?
We don't need to use active support in this case because we know the
type that will be returned.
2016-02-09 13:48:03 -08:00
Aaron Patterson
b2a9047558 Request#fullpath should not raise an exception, so remove the rescue 2016-02-09 13:34:44 -08:00
Aaron Patterson
d5c6babd9e AC::Request#format always returns a value, so we do not need to try 2016-02-09 12:12:15 -08:00
Rafael França
6454ee2c69 Merge pull request #23577 from dgynn/docs_initializers
Update documentation regarding initializers
2016-02-09 17:59:54 -02:00
Dave Gynn
836f6f1747 Update documentation regarding initializers [ci skip]
- Remove ActionController `logger` and `initialize_framework_caches`
  which were merged into `set_configs` in fbc9d0f4
- Rename ActiveRecord `set_reloader_hooks` changed in 283a0876
- Add missing initializers for ActionController and ActiveRecord
2016-02-09 14:51:23 -05:00
Vipul A M
0e70595acc Merge pull request #23571 from y-yagi/remove_deprecated_render_nothing_from_guide
remove description of `render :nothing` from guide [ci skip]
2016-02-09 11:21:46 +05:30
yuuji.yaginuma
9e70daa941 remove description of render :nothing from guide [ci skip]
`:nothing` option was deprecated in 44781b6e9790d90b4f8b9a41d2b2c114b1a582ee
2016-02-09 14:38:50 +09:00
Jon Moss
43e902a65f Merge pull request #23567 from kamipo/fix_typo
Fix typo [ci skip]
2016-02-08 19:58:42 -05:00
Ryuta Kamizono
3f184cab48 Fix typo [ci skip] 2016-02-09 09:47:47 +09:00
Aaron Patterson
783858c8e1 drop array allocations on html_safe
For better or worse, anonymous `*` args will allocate arrays.  Ideally,
the interpreter would optimize away this allocation.  However, given the
number of times we call `html_safe` it seems worth the shedding idealism
and going for performance.  This line was the top allocation spot for a
scaffold (and presumably worse on real applications).
2016-02-08 15:48:59 -08:00
Aaron Patterson
02c3867882 speed up string xor operation and reduce object allocations
```
[aaron@TC rails (master)]$ cat xor.rb
a = "\x14b\"\xB4P8\x05\x8D\xC74\xC3\xEC}\xFDf\x8E!h\xCF^\xBF\xA5%\xC6\xF0\xA9\xF9x\x04\xFA\xF1\x82"
b = "O.\xF7\x01\xA9D\xA3\xE1D\x7FU\x85\xFC\x8Ak\e\x04\x8A\x97\x91\xD01\x02\xA4G\x1EIf:Y\x0F@"

def xor_byte_strings(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

require 'benchmark/ips'
require 'allocation_tracer'

Benchmark.ips do |x|
  x.report 'xor_byte_strings' do
    xor_byte_strings a, b
  end

  x.report 'xor_byte_strings2' do
    xor_byte_strings2 a, b
  end
end

ObjectSpace::AllocationTracer.setup(%i{type})
result = ObjectSpace::AllocationTracer.trace do
  xor_byte_strings a, b
end
p :xor_byte_strings => result
ObjectSpace::AllocationTracer.clear
result = ObjectSpace::AllocationTracer.trace do
  xor_byte_strings2 a, b
end
p :xor_byte_strings2 => result
[aaron@TC rails (master)]$ ruby -I~/git/allocation_tracer/lib xor.rb
Calculating -------------------------------------
    xor_byte_strings    10.087k i/100ms
   xor_byte_strings2    11.339k i/100ms
-------------------------------------------------
    xor_byte_strings    108.386k (± 5.8%) i/s -    544.698k
   xor_byte_strings2    122.239k (± 3.0%) i/s -    612.306k
{:xor_byte_strings=>{[: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]}}
```
2016-02-08 15:40:25 -08:00
Jon Moss
e6fc78bfbd Merge pull request #23565 from abhishekjain16/fix_grammar
[ci skip] Fix grammar
2016-02-08 18:03:41 -05:00
Abhishek Jain
c2b9a5dbef [ci skip] Fix grammar 2016-02-09 04:16:28 +05:30
Arthur Nogueira Neves
98ed722039 Merge pull request #23534 from bronson/fix-redefined-warning
fix 'method redefined' warnings
2016-02-08 17:19:15 -05:00
Jon Moss
6c785f0df7 Merge pull request #23563 from pra85/patch-2
Fix a typo
2016-02-08 12:40:24 -05:00
Prayag Verma
581c2a6547 Fix a typo
Replace `a` with `an`
2016-02-08 22:40:48 +05:30
Rafael Mendonça França
9b5ae716db Revert "Merge pull request #23562 from Azzurrio/patch-1"
This reverts commit 8c3cca5e113213958469b1cec8aa9a664535251a, reversing
changes made to 9dcf67c4da35b165301865d9721da1d552f7e03f.

Reason: https://github.com/rails/rails/pull/23562#issuecomment-181442569
2016-02-08 14:09:29 -02:00
Kasper Timm Hansen
8c3cca5e11 Merge pull request #23562 from Azzurrio/patch-1
Update rails-html-sanitizer version to  v1.0.3
2016-02-08 16:43:07 +01:00
Karim El-Husseiny
ec82c13dd4 Update rails-html-sanitizer version to v1.0.3
rails-html-sanitizer 1.0.2 is vulnerable: https://groups.google.com/d/msg/rubyonrails-security/uh--W4TDwmI/m_CVZtdbFQAJ
2016-02-08 17:04:31 +02:00
प्रथमेश Sonpatki
9dcf67c4da Merge pull request #23560 from prathamesh-sonpatki/rm-rails-4-from-assets-guide
Remove references to Rails 4 from assets guide [ci skip]
2016-02-08 19:54:00 +05:30
Kasper Timm Hansen
3b693dfb93 Merge pull request #23552 from bronson/revert-dev-cache
revert dev:cache to rake task, fixes #23410
2016-02-08 15:21:40 +01:00
Vipul A M
d3150c8106 Merge pull request #23558 from kamipo/add_numeric_type_in_doc
Add numeric type in the doc [ci skip]
2016-02-08 10:52:58 +05:30
Ryuta Kamizono
40fd56052b Add numeric type in the doc [ci skip]
Follow up to #23508.
2016-02-08 14:17:23 +09:00
Prathamesh Sonpatki
abef3c2b0d Remove references to Rails 4 from assets guide [ci skip] 2016-02-08 08:57:02 +05:30
प्रथमेश Sonpatki
e8580c63db Merge pull request #23556 from y-yagi/remove_faye-websocket_from_readme
remove `faye-websocket` dependency from README [ci skip]
2016-02-08 08:24:51 +05:30
yuuji.yaginuma
3546b3f0d4 remove faye-websocket dependency from README [ci skip]
`faye-websocket` gem is no longer used from 322dca293b3716ccaa09e7e82046e539b0d2ffda.
2016-02-08 11:47:03 +09:00
Jon Moss
2b18bd5ffa Merge pull request #23554 from romaimperator/update_action_cable_config_example
config examples for ActionCable now use Rails.application.config.action_cable
2016-02-07 21:24:10 -05:00
Richard Schneeman
8af52c0655 Merge pull request #23559 from mabras/patch-1
update turbolinks url [ci skip]
2016-02-07 20:25:52 -05:00
mabras
f83d57d3e1 update turbolinks url [ci skip] 2016-02-08 03:17:31 +02:00
Sean Griffin
a29a41fe54 Merge pull request #23547 from kamipo/schema_type_returns_symbol
`schema_type` returns symbol rather than string
2016-02-07 16:33:33 -07:00
Daniel Fox
0ec48ab0cb config examples for ActionCable now use Rails.application.config.action_cable
Some existing examples used ActionCable.server.config but for
configuring allowed_request_origins that is overridden in development
mode. The correct place to set that is
Rails.application.config.action_cable which the ActionCable initializer
loads from. I thought the other two examples should be changed as well
just in case a default value that would override a configured value is
introduced for either log_tags or disable_request_forgery_protection in
the future.
2016-02-07 17:02:47 -06:00
Scott Bronson
ba2aea9807 revert dev:cache to rake task, fixes #23410 2016-02-07 14:32:43 -08:00
Sean Griffin
5ccf8a9853 Merge pull request #23508 from meinac/add_numeric_type_into_migrations
Added numeric helper into `SchemaStatements` for MySQL and PostgreSQL
2016-02-07 15:31:29 -07:00
Jon Moss
76c42383c7 Merge pull request #23531 from coldnebo/docfix
doc changes to clarify asset pipeline
2016-02-07 16:57:17 -05:00