Skip to content
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.

Search methods for associations #93

Open
graywh opened this issue Mar 2, 2012 · 0 comments
Open

Search methods for associations #93

graywh opened this issue Mar 2, 2012 · 0 comments

Comments

@graywh
Copy link

graywh commented Mar 2, 2012

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant