aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #21640 from yahonda/doc_remove_default_nullArthur Nogueira Neves2015-09-151-2/+2
|\ | | | | [ci skip] Remove `DEFAULT NULL` from examples
| * [ci skip] Remove `DEFAULT NULL` from examplesYasuo Honda2015-09-161-2/+2
|/
* Merge pull request #21634 from ↵Kasper Timm Hansen2015-09-151-1/+1
|\ | | | | | | | | JuanitoFatas/feature/fewer-rack-env-direct-manipulate Use rack.session_options instead of directly change env
| * Use rack.session_options instead of directly change envJuanito Fatas2015-09-161-1/+1
| |
* | Merge pull request #21623 from schneems/schneems/schema-migration-docsRichard Schneeman2015-09-151-1/+5
|\ \ | |/ |/| Doc SchemaMigration class.
| * Doc SchemaMigration class.schneems2015-09-141-1/+5
| |
* | fewer direct env manipulationsAaron Patterson2015-09-152-2/+2
| | | | | | | | this commit removes some direct access to `env`.
* | allocate request objects with the env hash, set routes on the requestAaron Patterson2015-09-152-9/+6
| | | | | | | | | | This commit is to abstract the code away from the env hash. It no longer needs to have the routes key hard coded.
* | Merge pull request #21606 from Eric-Guo/masterRafael Mendonça França2015-09-151-2/+0
|\ \ | | | | | | Bundler tzinfo-data in windows, even first generated new app are Mac
| * | Bundler tzinfo-data in windows, even first generated new app are MacEric Guo2015-09-151-2/+0
| | |
* | | Merge pull request #20848 from ↵Arthur Nogueira Neves2015-09-141-1/+1
|\ \ \ | |/ / |/| | | | | | | | deivid-rodriguez/fix_undefined_method_error_on_exception Fix undefined method error on exception
| * | Fix undefined method error on exceptionDavid Rodríguez2015-07-111-1/+1
| | | | | | | | | | | | | | | | | | The `error` method is not defined, in general, for exceptions. Instead, print the exception message. This error was hiding actual meaningful DB configuration errors. See http://stackoverflow.com/questions/18774463.
* | | Merge pull request #20897 from lukechesser/guide-fix-for-acceptance-validationArthur Nogueira Neves2015-09-141-3/+7
|\ \ \ | | | | | | | | Update Validation guide for acceptance method
| * | | Update validation guide for acceptance methodLuke Chesser2015-07-161-3/+7
| | | |
* | | | only "normalize" onceAaron Patterson2015-09-141-1/+1
| | | |
* | | | Do not use conditionals at GemfileRafael Mendonça França2015-09-142-12/+7
| | | | | | | | | | | | | | | | This will make the Gemfile.lock be dirty in some environments
* | | | create a new renderer instance on calls to `for`Aaron Patterson2015-09-142-55/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the renderer class to store the controller and defaults as an instance variable rather than allocating a new class. You can create a new renderer with an new env by calling `Renderer#new` or use new defaults by calling `Renderer#with_defaults` and saving the return value somewhere. Also I want to keep the `env` private since I would like to change the keys in the future. This commit only translates particular keys that the user requested.
* | | | eagerly allocate the renderer objectAaron Patterson2015-09-143-9/+10
| | | | | | | | | | | | | | | | | | | | this means the reader doesn't need to lock, but does have the added cost of a new object created for every controller
* | | | initialize `@renderer` to avoid ivar warningsAaron Patterson2015-09-141-1/+8
| | | |
* | | | add a lock when allocating the rendererAaron Patterson2015-09-141-1/+5
| | | | | | | | | | | | | | | | | | | | The controller class is shared among threads, so we need to lock when allocating the Renderer.
* | | | Merge pull request #21616 from claudiob/fix-21122Rafael Mendonça França2015-09-141-68/+6
|\ \ \ \ | |_|_|/ |/| | | Remove methods that are never invoked
| * | | Remove AS methods that are never invokedclaudiob2015-09-131-68/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #21122 - does not change any current behavior; simply reflects the fact that two conditions of the if/else statement are never reached. The reason is #17227 which adds a default terminator to AS::Callbacks. Therefore, even callback chains that do not define a terminator now have a terminator, and `chain_config.key?(:terminator)` is always true. Of course, if no terminator was defined, then we want this new default terminator not to do anything special. What the terminator actually does (or should do) is discussed in #21218 but the simple fact that a default terminator exists makes this current PR valid. *Note* that the conditional/simple methods have not been removed in AS::Conditionals::Filter::After because of `:skip_after_callbacks_if_terminated` which lets a user decide **not** to skip after callbacks even if the chain was terminated.
* | | | `rack_response` should use the status it's givenAaron Patterson2015-09-141-1/+1
| | | |
* | | | Merge pull request #21619 from kamipo/fix_doc_of_text_limitClaudio B.2015-09-141-2/+2
|\ \ \ \ | | | | | | | | | | Fix doc of limit option for a text column [ci skip]
| * | | | Fix doc of limit option for a text column [ci skip]Ryuta Kamizono2015-09-141-2/+2
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow up #21591. The document of limit option for a text column is incorrect. MySQL: the limit is byte length, not character length Pg, Sqlite3: variable unlimited length
* | | | Merge pull request #21617 from lunks/patch-1Claudio B.2015-09-131-1/+2
|\ \ \ \ | | | | | | | | | | Fix HSTS default expire in ActionDispatch::SSL docs.
| * | | | Fix HSTS default expire in ActionDispatch::SSL docs.Pedro Nascimento2015-09-141-1/+2
|/ / / /
* | | | Merge pull request #21611 from amitsuroliya/improve_docsXavier Noria2015-09-131-1/+1
|\ \ \ \ | | | | | | | | | | fix typo intance -> instance in ActionView [ci skip]
| * | | | fix typo intance -> instance in ActionView [ci skip] amitkumarsuroliya2015-09-131-1/+1
|/ / / / | | | | | | | | `intance` should be `instance`
* | | | Merge pull request #21591 from kamipo/text_and_blob_limit_is_byte_lengthRafael Mendonça França2015-09-131-2/+2
|\ \ \ \ | | | | | | | | | | TEXT and BLOB limit is byte length, not character length.
| * | | | TEXT and BLOB limit is byte length, not character length.Ryuta Kamizono2015-09-111-2/+2
| | | | |
* | | | | Merge pull request #21568 from amitsuroliya/mysql_version_updateRafael Mendonça França2015-09-138-12/+12
|\ \ \ \ \ | | | | | | | | | | | | Updated MySQL documentation link to MySQL latest version 5.7 everywhe…
| * | | | | Updated MySQL documentation link to MySQL latest version 5.7 everywhere [ci ↵amitkumarsuroliya2015-09-108-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | skip] Bumps from `5.6` to `5.7`
* | | | | | Merge pull request #21604 from amitsuroliya/remove_wrong_docsRafael Mendonça França2015-09-121-2/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | Improving `in_time_zone` docs [ci skip]
| * | | | | | Improving `in_time_zone` docs [ci skip]amitkumarsuroliya2015-09-131-2/+1
|/ / / / / / | | | | | | | | | | | | `DateTime.utc` is not a valid method. It gives `NoMethodError: undefined method `utc` for DateTime:Class`. As we know that we can calculate `utc` time from `Time` Class, but we can’t calculate `utc` time from `DateTime` Class.
* | | | | | Merge pull request #21602 from Eric-Guo/masterRafael Mendonça França2015-09-122-29/+38
|\ \ \ \ \ \ | | | | | | | | | | | | | | Ruby 2.2.3 in windows need nokogiri 1.6.7.rc3
| * | | | | | Ruby 2.2.3 in windows need nokogiri 1.6.7.rc3 as it's the only version ↵Eric Guo2015-09-122-29/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | having correct pre-compiled so
* | | | | | | Merge pull request #21603 from Eric-Guo/dev_edge_commonYves Senn2015-09-121-10/+7
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | dev and edge have some common, so factor it out.
| * | | | | | dev and edge have some common, so factor it out.Eric Guo2015-09-131-10/+7
|/ / / / / /
* | | | | | Merge pull request #21596 from JuanitoFatas/perf/strip-heredocXavier Noria2015-09-121-2/+1
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | Improve String#strip_heredoc
| * | | | | Improve String#strip_heredocJuanito Fatas2015-09-121-2/+1
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Saves about 6 MB, about 40% faster. **strip_heredoc.rb** ```ruby require "active_support/core_ext/object/try" require "get_process_mem" class String def strip_heredoc indent = scan(/^[ \t]*(?=\S)/).min.try(:size) || 0 gsub(/^[ \t]{#{indent}}/, '') end end if ENV["MEASURE_MEMORY"] == "yes" mem = GetProcessMem.new GC.start GC.disable 10000.times do <<-MSG.strip_heredoc xhr and xml_http_request methods are deprecated in favor of `get :index, xhr: true` and `post :create, xhr: true` MSG end before = mem.mb after = mem.mb GC.enable puts "Before: #{before} MiB" puts "After: #{after} MiB" puts "Diff: #{after - before} MiB" end ``` **patched_strip_heredoc.rb** ```ruby require "active_support/core_ext/object/try" require "get_process_mem" class String def patched_strip_heredoc gsub(/^#{scan(/^[ \t]*(?=\S)/).min}/, "".freeze) end end if ENV["MEASURE_MEMORY"] == "yes" mem = GetProcessMem.new GC.start GC.disable 10000.times do <<-MSG.patched_strip_heredoc xhr and xml_http_request methods are deprecated in favor of `get :index, xhr: true` and `post :create, xhr: true` MSG end before = mem.mb after = mem.mb GC.enable puts "Before: #{before} MiB" puts "After: #{after} MiB" puts "Diff: #{after - before} MiB" end ``` **Before** ``` $ MEASURE_MEMORY=yes ruby strip_heredoc.rb Before: 44.73828125 MiB After: 44.7734375 MiB Diff: 0.03515625 MiB ``` **After** ``` $ MEASURE_MEMORY=yes ruby patched_strip_heredoc.rb Before: 37.9765625 MiB After: 38.015625 MiB Diff: 0.0390625 MiB ``` `44.7734375 - 38.015625 = 6.75` => **Saves about 6.75 MiB** **benchmark.rb** ```ruby require "benchmark/ips" require_relative "./strip_heredoc" require_relative "./patched_strip_heredoc" def original <<-MSG.strip_heredoc xhr and xml_http_request methods are deprecated in favor of `get :index, xhr: true` and `post :create, xhr: true` MSG end def patched <<-MSG.patched_strip_heredoc xhr and xml_http_request methods are deprecated in favor of `get :index, xhr: true` and `post :create, xhr: true` MSG end Benchmark.ips do |x| x.report("original") { original } x.report(" patched") { patched } x.compare! end ``` ``` $ ruby -v benchmark.rb ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14] Calculating ------------------------------------- original 5.652k i/100ms patched 6.477k i/100ms ------------------------------------------------- original 54.076k (± 5.7%) i/s - 271.296k patched 74.557k (± 6.2%) i/s - 375.666k Comparison: patched: 74557.0 i/s original: 54076.4 i/s - 1.38x slower ``` => **About 38% faster** 1. Clone rails project `git clone git@github.com:rails/rails.git` 2. Apply this patch to `activesupport/lib/active_support/core_ext/string/strip.rb` 3. `cd activesupport` 4. run `rake` 5. And tests passed: ``` ➜ activesupport $ rake /Users/Juan/.rubies/ruby-2.2.2/bin/ruby -w -I"lib:test" "/Users/Juan/.rubies/ruby-2.2.2/lib/ruby/2.2.0/rake/rake_test_loader.rb" "test/**/*_test.rb" ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ........................................................................ ......................................................................S. SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS Finished in 15.343004s, 214.2344 runs/s, 24902.4898 assertions/s. 3287 runs, 382079 assertions, 0 failures, 0 errors, 48 skips You have skipped tests. Run with --verbose for details. ```
* | | | | Merge pull request #21585 from lachlanjc/patch-1Eileen M. Uchitelle2015-09-101-1/+1
|\ \ \ \ \ | | | | | | | | | | | | Remove RHTML reference in Action Controller docs
| * | | | | Remove RHTML reference in Action Controller docs [ci skip]Lachlan Campbell2015-09-101-1/+1
|/ / / / /
* | | | | Merge pull request #21584 from claudiob/remove-hawd-docClaudio B.2015-09-101-3/+2
|\ \ \ \ \ | | | | | | | | | | | | Remove wrong doc line about AC::Parameters
| * | | | | Remove wrong doc line about AC::Parametersclaudiob2015-09-101-3/+2
| | |/ / / | |/| | | | | | | | | | | | | | | | | | AC::Parameters does not inherit from HashWithIndifferentAccess since #20868 by @sikachu
* | | | | Merge pull request #21575 from y-yagi/description_of_passing_block_to_add_sourceYves Senn2015-09-101-1/+9
|\ \ \ \ \ | | | | | | | | | | | | add description of passing a block to `add_source` [ci skip]
| * | | | | add description of passing a block to `add_source` [ci skip]yuuji.yaginuma2015-09-101-1/+9
|/ / / / / | | | | | | | | | | | | | | | block support added in 8cc01e0b2bfa75a613720c535d34e451f5de769c
* | / / / Explicitly require AR/attribute where using itAkira Matsuda2015-09-101-0/+2
| |/ / / |/| | | | | | | | | | | | | | | autoloading this could possibly cause some weird race condition when calling an AR::Attribute's singleton method on a threaded server.
* | | | Merge pull request #21567 from y-yagi/fix_inspect_docZachary Scott2015-09-091-1/+1
|\ \ \ \ | | | | | | | | | | fix wrong method used in the TimeWithZone#inspect method docs [ci skip]
| * | | | fix wrong method used in the TimeWithZone#inspect method docs [ci skip]yuuji.yaginuma2015-09-101-1/+1
| | | | |