Indeed. You can thank ActiveRecord for forcing me into that dark, mangy
hole.


On Fri, Jun 6, 2014 at 11:39 AM, David Reece <notifications@github.com>
wrote:

> In lib/versioned_record/composite_predicates.rb:
>
> >          end
> >          cpk_and_predicate(eq_predicates)
> >        else
> >          super
> >        end
> >      end
> > +
> > +    private
> > +      def add_belongs_to_predicates!(predicates, association_table)
> > +        if self.klass.versioned?
> > +          add_current_version_constraint!(predicates, association_table)
> > +        end
> > +      end
> > +
> > +      def add_habtm_predicates!(predicates, association, association_table)
> > +        if self.klass.versioned?
> > +          if association.reflection.klass.table_name == association_table.name
>
> You know you're up to something when you have a chain of
> association.reflection.klass.table_name.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/jobready/versioned_record/pull/6/files#r13473625>.
>



-- 
Dan Draper
CEO and Co-founder
www.codehire.com
<http://www.codehire.com/?utm_source=emailsig&utm_medium=email&utm_campaign=email>

Twitter: @danieldraper
Skype: danieldraper100
Mobile: +61403089661
LinkedIn: http://www.linkedin.com/in/ddraper