1. 27 12月, 2014 2 次提交
    • S
      Remove `klass` and `arel_table` as a dependency of `PredicateBuilder` · a60770d3
      Sean Griffin 提交于
      This class cares far too much about the internals of other parts of
      Active Record. This is an attempt to break out a meaningful object which
      represents the needs of the predicate builder. I'm not fully satisfied
      with the name, but the general concept is an object which represents a
      table, the associations to/from that table, and the types associated
      with it. Many of these exist at the `ActiveRecord::Base` class level,
      not as properties of the table itself, hence the need for another
      object. Currently it provides these by holding a reference to the class,
      but that will likely change in the future. This allows the predicate
      builder to remain wholy concerned with building predicates.
      
      /cc @mrgilman
      a60770d3
    • S
      Refactor association handling in `PredicateBuilder` · 3bbe88ec
      Sean Griffin 提交于
      I'm attempting to remove `klass` as a dependency of the predicate
      builder, in favor of an object that better represents what we're using
      it for. The only part of this which doesn't fit nicely into that picture
      is the check for an association being polymorphic. Since I'm not yet
      sure what that is going to look like, I've moved this logic into another
      class in an attempt to separate things that will change from things that
      won't.
      3bbe88ec