1. 14 1月, 2020 13 次提交
  2. 12 1月, 2020 6 次提交
  3. 11 1月, 2020 13 次提交
  4. 10 1月, 2020 8 次提交
    • E
      Fix numericality validator when defined on abstract class: · c507e930
      Edouard CHIN 提交于
      - ### Problem
      
        It's no longer possible to define a numeric validation on abstract
        class:
      
        ```ruby
          class AnimalsBase < ApplicationRecord
            self.abstract_class = true
      
            validates :age, numericality: { min: 18 }
          end
      
          class Dog < AnimalsBase
          end
      
          Dog.create!(age: 0) => ActiveRecord::TableNotSpecified: Dog has no table configured. Set one with Dog.table_name=
        ```
      
        ### Solution
      
        Instead of trying to get the type for attribute on the class
        defining the validation, get it from the record being validated.
      c507e930
    • R
      Merge pull request #38208 from alkesh26/action-cable/typo-fixes · a5593878
      Ryuta Kamizono 提交于
      Typo fix of visbility.
      a5593878
    • A
      Typo fix of visbility. · aed448cc
      alkeshghorpade 提交于
      aed448cc
    • A
    • E
      Ensure the reading connection always raises if we try to write · 1c98e6c0
      eileencodes 提交于
      Since test fixtures share connections (due to transactional tests) we
      end up overwriting the reading configuration so Rails doesn't recognize
      it as a replica connection.
      
      This change ensures that if we're using the `reading` role that
      connections will always have prevent writes turned on.
      
      If you need a replica connection that does not block writes, you should
      use a different role name other than `:reading`.
      
      The db selector test and connection handlers test have been updated to
      test for these changes. In the db selector test we don't always have a
      writing handler so I updated test fixtures to return if that's nil.
      
      Lastly one test needed to be updated to use a different handler name due
      to it needing to write to successfully test what it needs to test.
      
      Fixes #37765
      1c98e6c0
    • E
      Fix the reading can write resolver test · d89ee16b
      eileencodes 提交于
      This test wasn't correct. If we're calling `resolver.read` and want to
      actually read from the replicas then the role would be reading not
      writing. This was because the session store needed to be changed so that
      we actually are "reading from the replicas" instead of reading from the
      primary.
      d89ee16b
    • J
      Put dev dependencies in generated plugin Gemfile · 5fbf14b9
      Jonathan Hefner 提交于
      The Gemfile offers more flexibility than the gemspec in terms of gem
      groups and platforms.  Putting the default development dependencies in
      the Gemfile encourages users to add their own development dependencies
      to the Gemfile.  This is similar to the current behavior of the
      `bundle gem` command (see bundler/bundler#7222).
      
      This change also fixes a corner case where using the "--skip-gemspec"
      and "--skip-active-record" options together would incorrectly generate a
      "sqlite3" dependency in the Gemfile.
      5fbf14b9
    • J
      Merge branch 'fix_template_resolving_sort' · 7abcba69
      John Hawthorn 提交于
      7abcba69