aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | Silence deprecation warning from force reloadPrem Sichanugrist2015-07-1610-105/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We deprecate the support for passing an argument to force reload in 6eae366d0d2e5d5211eeaf955f56bd1dc6836758. That led to several deprecation warning when running Active Record test suite. This commit silence the warnings by properly calling `#reload` on the association proxy or on the association object instead. However, there are several places that `ActiveSupport::Deprecation.silence` are used as those tests actually tests the force reload functionality and will be removed once `master` is targeted next minor release (5.1).
* | | | | | | push is_a checks up the stackAaron Patterson2015-07-171-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | now `hash_filter` doesn't need to know about the `Parameters` class
* | | | | | | remove useless conditionalAaron Patterson2015-07-171-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we proved that `element` is always of type `Parameter`, we know that it will always respond to `permit`, so lets remove this conditional
* | | | | | | Merge pull request #20125Sean Griffin2015-07-173-0/+19
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Manually merged to fix conflicts.
| * | | | | | | ActiveSupport::HashWithIndifferentAccess select and reject should return ↵Bernard Potocki2015-07-173-0/+19
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | enumerator if called without block
* | | | | | | remove useless conditionalsAaron Patterson2015-07-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `element` can never be a hash because: 1. `slice` returns a Parameters object and calls each on it: https://github.com/rails/rails/blob/cb3f25593b1137e344086364d4b1a52c08e8eb3b/actionpack/lib/action_controller/metal/strong_parameters.rb#L656 2. `each` which is implemented by `each_pair` will call `convert_hashes_to_parameters` on the value: https://github.com/rails/rails/blob/cb3f25593b1137e344086364d4b1a52c08e8eb3b/actionpack/lib/action_controller/metal/strong_parameters.rb#L192-197 3. `convert_hashes_to_parameters` will convert any hash objects in to parameters objects: https://github.com/rails/rails/blob/cb3f25593b1137e344086364d4b1a52c08e8eb3b/actionpack/lib/action_controller/metal/strong_parameters.rb#L550-566
* | | | | | | remove useless functionAaron Patterson2015-07-171-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that the value is cached on the stack, `array_of_permitted_scalars_filter` is exactly the same as `array_of_permitted_scalars?`, so lets just have one
* | | | | | | stop passing `params` to `array_of_permitted_scalars_filter`Aaron Patterson2015-07-171-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this way the method doesn't have to know what the new params object is, it just yields to a block. This change also caches the value of `self[key]` on the stack
* | | | | | | push key checking upAaron Patterson2015-07-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We should disconnect `array_of_permitted_scalars_filter` from the instance so that we can make hash filtering functional. For now, pull the conditional up out of that method
* | | | | | | Merge pull request #20918 from jonatack/fix-lookup-grammarRafael Mendonça França2015-07-177-14/+17
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | [skip ci] Lookup can be a noun but it is not a verb
| * | | | | | [skip ci] Lookup can be a noun but it is not a verbJon Atack2015-07-177-14/+17
|/ / / / / / | | | | | | | | | | | | | | | | | | Various grammar corrections and wrap to 80 characters.
* | | | | | Merge pull request #20915 from robin850/jruby-skipsSean Griffin2015-07-173-0/+8
|\ \ \ \ \ \ | | | | | | | | | | | | | | Skip a few failing tests on JRuby with the attached tickets
| * | | | | | Skip a few failing tests on JRuby with the attached ticketsRobin Dupret2015-07-173-0/+8
|/ / / / / /
* | | | | | Merge pull request #20909 from yui-knk/fix/test-commnadClaudio B.2015-07-171-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | [ci skip] Add `bundle exec` to test run command
| * | | | | | [ci skip] Add `bundle exec` to test run commandyui-knk2015-07-171-1/+1
| | |_|_|_|/ | |/| | | |
* | | | | | Merge pull request #20905 from imtayadeway/tw/fix-db-pooling-docsClaudio B.2015-07-171-7/+7
|\ \ \ \ \ \ | | | | | | | | | | | | | | [skip ci] Improve grammar/style in DB pooling guide.
| * | | | | | [skip ci] Improve grammar/style in DB pooling guide.Tim Wade2015-07-161-7/+7
| |/ / / / /
* | | | | | Oops! :bomb:Akira Matsuda2015-07-171-1/+1
| | | | | |
* | | | | | "warning: instance variable @routes not initialized"Akira Matsuda2015-07-171-1/+1
|/ / / / /
* | | | | Merge pull request #20892 from zoltankiss/make-params-method-returns-consistentRafael Mendonça França2015-07-151-1/+1
|\ \ \ \ \ | |/ / / / |/| | | | Standardize `ActionController::Parameters#to_unsafe_h` return value
| * | | | Standardize `ActionController::Parameters#to_unsafe_h` return valueZoltan Kiss2015-07-151-1/+1
|/ / / / | | | | | | | | | | | | | | | | | | | | `ActionController::Parameters#to_h` returns a hash, so lets have `ActionController::Parameters#to_unsafe_h` return a hash instead of an `ActiveSupport::HashWithIndifferentAccess` for consistency.
* | | | Merge pull request #20888 from sikachu/remove-support-for-force-reloadRafael Mendonça França2015-07-159-0/+70
|\ \ \ \ | | | | | | | | | | Deprecate force association reload by passing true
| * | | | Deprecate force association reload by passing truePrem Sichanugrist2015-07-159-0/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is to simplify the association API, as you can call `reload` on the association proxy or the parent object to get the same result. For collection association, you can call `#reload` on association proxy to force a reload: @user.posts.reload # Instead of @user.posts(true) For singular association, you can call `#reload` on the parent object to clear its association cache then call the association method: @user.reload.profile # Instead of @user.profile(true) Passing a truthy argument to force association to reload will be removed in Rails 5.1.
* | | | | Merge pull request #20868 from sikachu/params-not-inherited-from-hwiaRafael Mendonça França2015-07-1510-38/+167
|\ \ \ \ \ | |/ / / / |/| | | | Make AC::Parameters not inherited from Hash
| * | | | Update documentation on `AC::Parameters`Prem Sichanugrist2015-07-152-7/+33
| | | | |
| * | | | Make AC::Parameters not inherited from HashPrem Sichanugrist2015-07-1510-35/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is another take at #14384 as we decided to wait until `master` is targeting Rails 5.0. This commit is implementation-complete, as it guarantees that all the public methods on the hash-inherited Parameters are still working (based on test case). We can decide to follow-up later if we want to remove some methods out from Parameters.
* | | | | Merge pull request #20887 from tgxworld/ar_callbacksRafael Mendonça França2015-07-158-23/+32
|\ \ \ \ \ | |/ / / / |/| | | | Revert "Revert "Reduce allocations when running AR callbacks.""
| * | | | Revert "Revert "Reduce allocations when running AR callbacks.""Guo Xiang Tan2015-07-168-23/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit bdc1d329d4eea823d07cf010064bd19c07099ff3. Before: Calculating ------------------------------------- 22.000 i/100ms ------------------------------------------------- 229.700 (± 0.4%) i/s - 1.166k Total Allocated Object: 9939 After: Calculating ------------------------------------- 24.000 i/100ms ------------------------------------------------- 246.443 (± 0.8%) i/s - 1.248k Total Allocated Object: 7939 ``` begin require 'bundler/inline' rescue LoadError => e $stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler' raise e end gemfile(true) do source 'https://rubygems.org' # gem 'rails', github: 'rails/rails', ref: 'bdc1d329d4eea823d07cf010064bd19c07099ff3' gem 'rails', github: 'rails/rails', ref: 'd2876141d08341ec67cf6a11a073d1acfb920de7' gem 'arel', github: 'rails/arel' gem 'sqlite3' gem 'benchmark-ips' end require 'active_record' require 'benchmark/ips' ActiveRecord::Base.establish_connection('sqlite3::memory:') ActiveRecord::Migration.verbose = false ActiveRecord::Schema.define do create_table :users, force: true do |t| t.string :name, :email t.boolean :admin t.timestamps null: false end end class User < ActiveRecord::Base default_scope { where(admin: true) } end admin = true 1000.times do attributes = { name: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", email: "foobar@email.com", admin: admin } User.create!(attributes) admin = !admin end GC.disable Benchmark.ips(5, 3) do |x| x.report { User.all.to_a } end key = if RUBY_VERSION < '2.2' :total_allocated_object else :total_allocated_objects end before = GC.stat[key] User.all.to_a after = GC.stat[key] puts "Total Allocated Object: #{after - before}" ```
* | | | | Merge pull request #20812 from aditya-kapoor/close-20694Robin Dupret2015-07-151-0/+16
|\ \ \ \ \ | | | | | | | | | | | | [ci skip] add note for individual stub creation
| * | | | | [ci skip] add note for individual stub creationAditya Kapoor2015-07-151-0/+16
|/ / / / /
* | | | | Rack implements `redirect?` so we don't need itAaron Patterson2015-07-142-6/+0
| | | | | | | | | | | | | | | | | | | | Rack [already implements `redirect?` on the response object](https://github.com/rack/rack/blob/1569a985e17d9caaf94d0e97d95ef642c4ab14ba/lib/rack/response.rb#L141) so we don't need to implement our own.
* | | | | Fix Gemfile.lockRafael Mendonça França2015-07-141-1/+0
| | | | |
* | | | | Remove concurrent-ruby from Action Pack gemspecRafael Mendonça França2015-07-141-1/+0
| | | | | | | | | | | | | | | | | | | | It is already on Active Support
* | | | | Merge pull request #20866 from jdantonio/countdown-latchAaron Patterson2015-07-1411-58/+70
|\ \ \ \ \ | | | | | | | | | | | | Replace `ActiveSupport::Concurrency::Latch` with `Concurrent::CountDownLatch` from concurrent-ruby.
| * | | | | Replaced `ActiveSupport::Concurrency::Latch` with concurrent-ruby.Jerry D'Antonio2015-07-1311-58/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The concurrent-ruby gem is a toolset containing many concurrency utilities. Many of these utilities include runtime-specific optimizations when possible. Rather than clutter the Rails codebase with concurrency utilities separate from the core task, such tools can be superseded by similar tools in the more specialized gem. This commit replaces `ActiveSupport::Concurrency::Latch` with `Concurrent::CountDownLatch`, which is functionally equivalent.
* | | | | | Merge pull request #20877 from sikachu/rename-ac-test_responseRafael Mendonça França2015-07-144-4/+4
|\ \ \ \ \ \ | | | | | | | | | | | | | | Change AC::TestResponse to AD::TestResponse
| * | | | | | Change AC::TestResponse to AD::TestResponsePrem Sichanugrist2015-07-144-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ActionController::TestResponse was removed in d9fe10c and caused a test failure on Action View as its test case still refers to it.
* | | | | | | only call methods that are on the superclassAaron Patterson2015-07-143-7/+6
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We want to treat the response object as if it's a real response object (not a test object), so we should only call methods that are on the superclass.
* | | | | | Merge pull request #20870 from y-yagi/test_runner_inside_engineKasper Timm Hansen2015-07-144-7/+13
|\ \ \ \ \ \ | | | | | | | | | | | | | | make test runner work correctly inside engine
| * | | | | | make test runner work correctly inside engineyuuji.yaginuma2015-07-124-7/+13
| | | | | | |
* | | | | | | use a lookup table for `assert_response`Aaron Patterson2015-07-132-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We shouldn't depend on specific methods imlemented in the TestResponse subclass because the response could actually be a real response object. In the future, we should either push the aliased predicate methods in TestResponse up to the real response object, or remove them
* | | | | | | only have one TestResponse classAaron Patterson2015-07-132-5/+2
| | | | | | |
* | | | | | | move buffer caching on to the bufferAaron Patterson2015-07-133-7/+15
| | | | | | |
* | | | | | | Merge pull request #20736 from antoine-lizee/docsRobin Dupret2015-07-133-2/+7
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | [ci skip] docs: making clear that perform_caching has a limited impact
| * | | | | | | [ci skip] doc: making clear that perform_caching has a limited impactantoine.lizee2015-07-133-2/+7
| | | | | | | |
* | | | | | | | Remove JRuby and Rubinius from the travis matrixRafael Mendonça França2015-07-131-4/+0
| |_|/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will save Travis some precious resource since it will not need to run 18 jobs for these Ruby implementations on every push or pull request. We do care about these implementations but we should fix the build locally before having it running on travis. We would love to have someone working on this but right now it is not our reality.
* | | | | | | Merge pull request #20852 from hedgesky/fix_typo_in_caching_guideKasper Timm Hansen2015-07-121-1/+1
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | fix typo in caching guide [ci skip]
| * | | | | | fix typo in caching guide [ci skip]Anton Chuchkalov2015-07-121-1/+1
|/ / / / / /
* | | | | | Merge pull request #20842 from TheBlasfem/removed_usage_lines_docsClaudio B.2015-07-112-2/+2
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | Removed usage line docs [ci skip]
| * | | | | added description instead of remove usage [ci skip]Julio Lopez2015-07-112-2/+2
| | |_|/ / | |/| | |