Permalink
Switch branches/tags
Commits on Oct 16, 2018
  1. Merge pull request #34227 from bkuhlmann/master-lazy_mysql_version_ch…

    tenderlove committed Oct 16, 2018
    …eck_support
    
    Refactored abstract MySQL adapter to support lazy version check.
Commits on Sep 26, 2018
  1. Merge pull request #33970 from rails/eager-url-helpers

    tenderlove committed Sep 26, 2018
    Eagerly build the routing helper module after routes are committed
  2. Merge branch 'master' into eager-url-helpers

    tenderlove committed Sep 26, 2018
    * master:
      Remove force parent loading when counter cache child is created/destroyed
      Raise an error when loading all fixtures from nil fixture_path
      Revert "Remove `counter_cache_target` which is no longer called"
      Update counter cache in memory if parent target is existed
      If association is a hash-like object preloading fails
      Use the same option for create database statements between Raketask and travis.rb
      Fix "warning: shadowing outer local variable - config"
      Remove `counter_cache_target` which is no longer called
      Fix more offences
      Change the empty block style to have space inside of the block
      Fix a content_for test description
      Stringify database configurations
      Improve error message when assign wrong attributes to model
  3. Routes from Engine Railties should not be an infinite loop

    tenderlove committed Sep 26, 2018
  4. Eager load supports individual files

    tenderlove committed Sep 26, 2018
    Also we want to eager load routes before anything else.
Commits on Sep 25, 2018
  1. Allow helpers to be deferred until the routes have been finalized

    tenderlove committed Sep 25, 2018
    ActiveStorage::BaseController subclasses ActionController::Base.
    ActionController::Base has an "inherited" hook set that includes the
    routing helpers to any subclass of AC::Base.  Since
    ActiveStorage::BaseController is a subclass of AC::Base, it will get
    routing helpers included automatically.  Unfortunately, when the
    framework is eagerly loaded, ActiveStorage::BaseController is loaded
    *before* the applications routes are loaded which means it attempts to
    include an "in flight" module so it gets an exception.
    
    This commit allows a class that's interested in being extended with
    routing helpers register itself such that when the routes are finalized,
    it will get the helpers included.  If the routes are already finalized,
    then the helpers get included immediately.
  2. Eagerly build the routing helper module after routes are committed

    tenderlove committed Sep 24, 2018
    This commit eagerly builds the route helper module after the routes have
    been drawn and finalized.  This allows us to cache the helper module but
    not have to worry about people accessing the module while route
    definition is "in-flight", and automatically deals with cache
    invalidation as the module is regenerated anytime someone redraws the
    routes.
    
    The restriction this commit introduces is that the url helper module can
    only be accessed *after* the routes are done being drawn.
    
    Refs #24554 and #32892
  3. Merge pull request #33974 from rails/remove-catch-all-from-am

    tenderlove committed Sep 25, 2018
    This patch removes deprecated catch-all routes from AM
  4. Merge pull request #33973 from rails/remove-catch-all

    tenderlove committed Sep 25, 2018
    Remove deprecated catch-all route in the AV tests
Commits on Sep 24, 2018
  1. This patch removes deprecated catch-all routes from AM

    tenderlove committed Sep 24, 2018
    It also removes a monkey patch from AM::Base
  2. make bot happy

    tenderlove committed Sep 24, 2018
  3. Add hack to deal with warnings

    tenderlove committed Sep 24, 2018
    We should be able to remove this once the catch-all route is gone from
    AP
  4. Remove deprecated catch-all route in the AV tests

    tenderlove committed Sep 24, 2018
    This commit removes a deprecated catch-all route in the AV tests.  It
    defines and includes the necessary routes for each test such that we
    don't need the catch-all anymore.
    
    This also helps push us toward #33970
Commits on Sep 6, 2018
  1. Merge pull request #33808 from itsbagpack/fix-access-safety-buffer-slice

    tenderlove committed Sep 6, 2018
    Maintain html_safe? on sliced HTML safe strings
Commits on Aug 23, 2018
  1. Merge pull request #33681 from minaslater/replace-white-and-blacklist

    tenderlove committed Aug 23, 2018
    [ci skip] change all instances of blacklist and whitelist to denylist…
Commits on Jul 26, 2018
  1. I cannot spell

    tenderlove committed Jul 26, 2018
  2. Merge pull request #33451 from rails/event-object-subscription

    tenderlove committed Jul 26, 2018
    Add event object subscriptions to AS::Notifications
  3. Add changelog entry

    tenderlove committed Jul 26, 2018
  4. fix arity check to use "parameters" for backwards compat

    tenderlove committed Jul 26, 2018
  5. Always subscribe to event objects via `AS::Notifications.subscribe`

    tenderlove committed Jul 26, 2018
    We don't need to have a special subscribe method for objects.  The
    regular `subscribe` method is more expensive than a specialized method,
    but `subscribe` should not be called frequently.  If that turns out to
    be a hotspot, we can introduce a specialized method.  :)
  6. Subscribe to event objects via `subscribe_event`

    tenderlove committed Jul 26, 2018
    Fanout notifier can send event objects to subscribers now.  Also moved
    `end` lower in the `finish!` method to guarantee that CPU time is
    shorter than real time.
  7. Merge pull request #33449 from rails/use-process-clock-instead-of-time

    tenderlove committed Jul 26, 2018
    Add cpu time, idle time, and allocations features to log subscriber events
Commits on Jun 26, 2018
  1. Merge pull request #33223 from rails/homogeneous-allocation

    tenderlove committed Jun 26, 2018
    Speed up homogeneous AR lists / reduce allocations
  2. Fix documentation based on feedback

    tenderlove committed Jun 26, 2018
  3. define attribute methods in `init_from_db`

    tenderlove committed Jun 26, 2018
    Now that `allocate` is removed, we need to define attribute methods in
    all "init" methods.
  4. Merge branch 'master' into homogeneous-allocation

    tenderlove committed Jun 26, 2018
    * master:
      Call initialize after allocate
      Remove `ActiveSupport::Concern` from `ActiveRecord::Aggregations`
      Add example for no_touching? in active_record/no_touching for api docs [ci skip]
      Generate a new key for each service test
  5. Merge pull request #33227 from rails/remove-allocate

    tenderlove committed Jun 26, 2018
    Call initialize after allocate
  6. Call initialize after allocate

    tenderlove committed Jun 26, 2018
    If someone calls allocate on the object, they'd better also call an
    initialization routine too (you can't expect allocate to do any
    initialization work).  Before this commit, AR objects that are
    instantiated from the database would call `define_attribute_methods`
    twice.
Commits on Jun 25, 2018
  1. Speed up homogeneous AR lists / reduce allocations

    tenderlove committed Jun 25, 2018
    This commit speeds up allocating homogeneous lists of AR objects.  We
    can know if the result set contains an STI column before initializing
    every AR object, so this change pulls the "does this result set contain
    an STI column?" test up, then uses a specialized instantiation function.
    This way we only have to check for an STI column once rather than N
    times.
    
    This change also introduces a new initialization function that is meant
    for use when allocating AR objects that come from the database.  Doing
    this allows us to eliminate one hash allocation per AR instance.
    
    Here is a benchmark:
    
    ```ruby
    require 'active_record'
    require 'benchmark/ips'
    
    ActiveRecord::Base.establish_connection adapter: "sqlite3", database: ":memory:"
    
    ActiveRecord::Migration.verbose = false
    
    ActiveRecord::Schema.define do
      create_table :users, force: true do |t|
        t.string :name
        t.timestamps null: false
      end
    end
    
    class User < ActiveRecord::Base; end
    
    2000.times do
      User.create!(name: "Gorby")
    end
    
    Benchmark.ips do |x|
      x.report("find") do
        User.limit(2000).to_a
      end
    end
    ```
    
    Results:
    
    Before:
    
    ```
    [aaron@TC activerecord (master)]$ be ruby -I lib:~/git/allocation_tracer/lib speed.rb
    Warming up --------------------------------------
                    find     5.000  i/100ms
    Calculating -------------------------------------
                    find     56.192  (± 3.6%) i/s -    285.000  in   5.080940s
    ```
    
    After:
    
    ```
    [aaron@TC activerecord (homogeneous-allocation)]$ be ruby -I lib:~/git/allocation_tracer/lib speed.rb
    Warming up --------------------------------------
                    find     7.000  i/100ms
    Calculating -------------------------------------
                    find     72.204  (± 2.8%) i/s -    364.000  in   5.044592s
    ```
  2. Merge pull request #33221 from rails/lazy-aggregate

    tenderlove committed Jun 25, 2018
    Lazily add `Aggregations` to `composed_of` models
  3. Lazily add `Aggregations` to `composed_of` models

    tenderlove committed Jun 25, 2018
    `composed_of` is a fairly rare method to call on models.  This commit
    adds the `Aggregations` module to models that call `composed_of` so that
    models that *don't* call `composed_of` don't need to instantiate the
    `aggregation_cache` hash.  This saves one hash allocation per model
    instance that doesn't use `composed_of`
Commits on Jun 11, 2018
  1. Merge pull request #33093 from rails/use-rack-to-dump-query

    tenderlove committed Jun 11, 2018
    Use Rack to generate query information under test
Commits on Jun 8, 2018
  1. Use Rack to generate query information under test

    tenderlove committed Jun 8, 2018
    `to_query` sorts parameters before encoding them.  This causes a round
    tripping issue as noted here:
    
      #23997 (comment)
      #10529 (comment)
      #30558
    
    Unfortunately, that method is being used to generate cache keys, so its
    results need to be stable:
    
      10dec0e
    
    However, the test harness is only using `to_query` to encode parameters
    before sending them to the controller so the "cache key" usecase doesn't
    apply here.
    
    This commit adds a test that demonstrates the round trip problems and
    changes the serialization strategy to use Rack for encoding the
    parameters rather than `to_query`.