Skip to content
This repository has been archived by the owner on Apr 9, 2019. It is now read-only.

Commit

Permalink
new cohort_analysis doesn't add arbitrary parens (grouping)
Browse files Browse the repository at this point in the history
  • Loading branch information
seamusabshere committed Jun 6, 2012
1 parent b275996 commit d4a45e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/test_weighted_average.rb
Expand Up @@ -186,7 +186,7 @@

it "does custom weighting, with a cohort" do
should_have_same_sql(
"SELECT SUM(segments.passengers * segments.load_factor * 1.0) / SUM(segments.passengers) FROM segments WHERE (segments.payload = 5) AND segments.load_factor IS NOT NULL AND segments.passengers > 0",
"SELECT SUM(segments.passengers * segments.load_factor * 1.0) / SUM(segments.passengers) FROM segments WHERE segments.payload = 5 AND segments.load_factor IS NOT NULL AND segments.passengers > 0",
Segment.cohort(:payload => 5).weighted_average_relation(:load_factor, :weighted_by => :passengers)
)
end
Expand Down

0 comments on commit d4a45e1

Please sign in to comment.