1. 09 10月, 2018 2 次提交
    • R
      Generate delegation methods to named scope in the definition time · 136b738c
      Ryuta Kamizono 提交于
      The delegation methods to named scope are defined when `method_missing`
      is invoked on the relation.
      
      Since #29301, the receiver in the named scope is changed to the relation
      like others (e.g. `default_scope`, etc) for consistency.
      
      Most named scopes would be delegated from relation by `method_missing`,
      since we don't allow scopes to be defined which conflict with instance
      methods on `Relation` (#31179). But if a named scope is defined with the
      same name as any method on the `superclass` (e.g. `Kernel.open`), the
      `method_missing` on the relation is not invoked.
      
      To address the issue, make the delegation methods to named scope is
      generated in the definition time.
      
      Fixes #34098.
      136b738c
    • R
      Call `define_attribute_methods` before `assert_no_queries` to address CI flakiness · a1ee4a9f
      Ryuta Kamizono 提交于
      Follow up 45be690f.
      
      Somehow calling `define_attribute_methods` in `build`/`new` sometimes
      causes the `table_exists?` query.
      
      To address CI flakiness due to `assert_no_queries` failure, ensure
      `define_attribute_methods` before `assert_no_queries`.
      a1ee4a9f
  2. 08 10月, 2018 11 次提交
  3. 07 10月, 2018 8 次提交
  4. 06 10月, 2018 19 次提交