0

I'm trying to use Squeel to compare attributes among the joined tables along with a little math.

Here's an example of the query:

Parent.joins{[child1, child2.grandchildren]}.
where{grandchildren.birth_datetime > Time.now - child1.age.years}

I get an error from Squeel saying "TypeError: can't convert Squeel::Nodes::KeyPath into an exact number"

Anyone know what I'm doing wrong here?

joshblour
  • 1,024
  • 10
  • 19

1 Answers1

0

Does

Parent.
  joins{[child1, child2.grandchildren]}.
  where{child2.grandchildren.birth_datetime > (Time.current - child1.age.years)}

do the trick?

Chris Keele
  • 3,364
  • 3
  • 30
  • 52