0

I have squeel installed and would like to do the following:

@branches = Branch.near(@latlon) #This provides an array of nearby branches

@dispensers = Dispenser.joins{@branches} #This does not work

I could geocode my dispensers, but I'd generally prefer the option above, if possible using active record, or active record + squeel. There must be some easy way to pull this off in Rails.

Abram
  • 39,950
  • 26
  • 134
  • 184
  • Dispenser.where{branch_id >> @branches} ??? You can't join an array, but you can add it to the where clause. – cpuguy83 Sep 25 '12 at 12:45
  • Could you tell us more about your models? Like what kind of association they have with each other. – basgys Jun 01 '13 at 22:12

0 Answers0