Skip to content

Commit

Permalink
Merge 2a3ca06 into 512bc05
Browse files Browse the repository at this point in the history
  • Loading branch information
mockdeep committed May 6, 2014
2 parents 512bc05 + 2a3ca06 commit 69fdef1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/integration/associations_spec.rb
Expand Up @@ -364,6 +364,11 @@

model do
belongs_to :parent
default_scope { where('parent_id IS NOT NULL') }
include PgSearch
pg_search_scope :search_parent, :associated_against => {
:parent => [:name],
}
end
end

Expand All @@ -377,6 +382,13 @@

results.should include(included)
results.should_not include(excluded)

included_child = Child.create!(:parent => included)
excluded_child = Child.create!
results = Child.includes(:parent).search_parent('bar.foo')

results.should include(included_child)
results.should_not include(excluded_child)
end
end
end
Expand Down

0 comments on commit 69fdef1

Please sign in to comment.