Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Search methods for associations #93

Open
graywh opened this Issue · 0 comments

1 participant

@graywh

Given

class Parent < ActiveRecord::Base
  scope :current, lambda { where(['lifespan_start <= ?', Date.today]).where(['lifespan_end >= ?', Date.today]) }
  search_methods :current
end

class Child < ActiveRecord::Base
  belongs_to :parent
end

it would be nice to be able to

Child.search({ :parent_current => 1 })

Currently getting an undefined method `parent_current=' error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.