1. 02 9月, 2016 2 次提交
  2. 01 9月, 2016 4 次提交
    • S
      Include user defined attributes in inspect · 8ab9daf2
      Sean Griffin 提交于
      The fact that this only includes column names is an oversight.
      8ab9daf2
    • S
      Remove deprecated handling of PG Points · b347156b
      Sean Griffin 提交于
      There are some minor changes to the point type as I had forgotten that
      this will affect the behavior of `t.point` in migrations and the schema
      dumper so we need to handle those as well.
      
      I'll say this again so I can convince myself to come up with a better
      structure... TYPES SHOULD NOT CARE ABOUT SCHEMA DUMPING AND WE NEED TO
      BETTER SEPARATE THESE.
      b347156b
    • S
      Revert "Extract `PredicateBuilder::CaseSensitiveHandler`" · 84efde74
      Sean Griffin 提交于
      This reverts commit 3a1f6fe7.
      
      This commit takes the code in a direction that I am looking to avoid.
      The predicate builder should be purely concerned with AST construction
      as it matters to methods like `where`. Things like case sensitivity
      should continue to be handled elsewhere.
      84efde74
    • S
      Attempt to maintain encoding for arrays of strings with PG · 7ba3a48d
      Sean Griffin 提交于
      I still think that this is something that should be handled in the pg
      gem, but it's not going to end up happening there so we'll do it here
      instead. Once we bump to pg 0.19 we can pass the encoding to the
      `encode` method instead.
      
      This issue occurs because C has no concept of encoding (or strings,
      really). The bytes that we pass here when sending the value to the
      database will always be interpreted as whatever encoding the connection
      is currently configured to use. That means that roundtripping to the
      database will lose no information
      
      However, after assigning we round trip through our type system without
      hitting the database. The only way that we can do the "correct" thin
      here would be to actually give a reference to the connection to the
      array type and have it check the current value of the connection's
      encoding -- which I'm strongly opposed to. We could also pass in the
      encoding when it's constructed, but since that can change independently
      of the type I'm not a huge fan of that either.
      
      This feels like a reasonable middle ground, where if we have an array of
      strings we simply use the encoding of the string we're given.
      
      Fixes #26326.
      7ba3a48d
  3. 31 8月, 2016 3 次提交
    • S
      Override `respond_to_missing?` instead of `respond_to?` when possible · 03d3f036
      Sean Griffin 提交于
      This was almost every case where we are overriding `respond_to?` in a
      way that mirrors a parallel implementation of `method_missing`. There is
      one remaining case in Active Model that should probably do the same
      thing, but had a sufficiently strange implementation that I want to
      investigate it separately.
      
      Fixes #26333.
      03d3f036
    • S
      Ensure that inverse associations are set before running callbacks · caa178c1
      Sean Griffin 提交于
      If a parent association was accessed in an `after_find` or
      `after_initialize` callback, it would always end up loading the
      association, and then immediately overwriting the association we just
      loaded. If this occurred in a way that the parent's `current_scope` was
      set to eager load the child, this would result in an infinite loop and
      eventually overflow the stack.
      
      For records that are created with `.new`, we have a mechanism to
      perform an action before the callbacks are run. I've introduced the same
      code path for records created with `instantiate`, and updated all code
      which sets inverse instances on newly loaded associations to use this
      block instead.
      
      Fixes #26320.
      caa178c1
    • S
      Refactor remove duplication. · 547698e8
      Santosh Wadghule 提交于
      547698e8
  4. 28 8月, 2016 3 次提交
  5. 26 8月, 2016 3 次提交
  6. 23 8月, 2016 4 次提交
  7. 20 8月, 2016 1 次提交
  8. 19 8月, 2016 5 次提交
  9. 18 8月, 2016 5 次提交
  10. 17 8月, 2016 2 次提交
  11. 16 8月, 2016 8 次提交
    • R
      Finder bang method should call non bang method · 9d008884
      Ryuta Kamizono 提交于
      Otherwise CollectionProxy's bang methdos cannot respect dirty target.
      9d008884
    • R
      Fix inconsistent the signature of finder methods for collection association · 46380674
      Ryuta Kamizono 提交于
      `#second`, `#third`, etc finder methods was added in 03855e79.
      But the signature of these methods is inconsistent with the original
      finder methods. And also the signature of `#first` and `#last` methods
      is different from the original. This commit fixes the inconsistency.
      46380674
    • M
      Fix count which would sometimes force a DISTINCT · 0aae7806
      Maxime Lapointe 提交于
      The current behaviour of checking if there is a LEFT OUTER JOIN arel
      node to detect if we are doing eager_loading is wrong. This problem
      wasn't frequent before as only some pretty specific cases would add
      a LEFT OUTER JOIN arel node. However, the recent new feature
      left_outer_joins also add this node and made this problem happen
      frequently.
      
      Since in the perform_calculation function, we don't have access to
      eager_loading information, I had to extract the logic for the distinct
      out to the calculate method.
      
      As I was in the file for left_outer_join tests, I fixed a few that had
      bugs and I replaced some that were really weak with something that
      will catch more issues.
      
      In relation tests, the first test I changed would have failed if it
      had validated the hash returned by count instead of just checking how
      many pairs were in it. This is because this merge of join currently
      transforms the join node into an outer join node, which then made
      count do a distinct. So before this change, the return was
      {1=>1, 4=>1, 5=>1}.
      0aae7806
    • J
      Makes touch_later respects no_touching policy · ed34b676
      Jean Boussier 提交于
      ed34b676
    • R
      Extract `PredicateBuilder::CaseSensitiveHandler` · 3a1f6fe7
      Ryuta Kamizono 提交于
      Currently uniqueness validator is coupled with building Arel ASTs.
      This commit extracts `PredicateBuilder::CaseSensitiveHandler` for
      decouple the building Arel ASTs.
      3a1f6fe7
    • R
      Do not handle as an associated predicate if a table has the column · c6a62dc3
      Ryuta Kamizono 提交于
      If handled as an associated predicate even though a table has the
      column, will generate invalid SQL by valid column name treated as a
      table name.
      c6a62dc3
    • O
      Add array column documentation · 91aa3ba2
      oss92 提交于
      91aa3ba2
    • R
      Add three new rubocop rules · 55f9b812
      Rafael Mendonça França 提交于
      Style/SpaceBeforeBlockBraces
      Style/SpaceInsideBlockBraces
      Style/SpaceInsideHashLiteralBraces
      
      Fix all violations in the repository.
      55f9b812