Skip to content

Commit

Permalink
fix computed attribute tes
Browse files Browse the repository at this point in the history
  • Loading branch information
diegosenarruzza committed Nov 3, 2020
1 parent ed0abe3 commit 2535b06
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion spec/computed_attribute_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@

dataset.join_table(:inner, subquery, :user_id => :id)
end
expected_query = "SELECT * FROM `users` INNER JOIN (SELECT `user_id`, count(`id`) AS 'value' FROM `comments` GROUP BY `user_id`) AS 'comments_count' ON (`comments_count`.`user_id` = `users`.`id`)"
expected_query = "SELECT *, `comments_count`.`value` AS 'value' FROM `users` INNER JOIN (SELECT `user_id`, count(`id`) AS 'value' FROM `comments` GROUP BY `user_id`) AS 'comments_count' ON (`comments_count`.`user_id` = `users`.`id`)"
computed_attribute.apply_join(dataset)
.select_append(computed_attribute.identifier)
.sql
.must_equal expected_query
end
Expand Down

0 comments on commit 2535b06

Please sign in to comment.