VRFS-2916 fixed subquery override from block

This commit is contained in:
Jonathan Kolyer 2015-03-23 04:48:13 +00:00
parent 128a8119cf
commit dd23b38f4e
1 changed files with 2 additions and 2 deletions

View File

@ -168,7 +168,7 @@ WHERE
tt.created_at >= '#{start_date}' AND
tt.created_at <= '#{end_date}'
SQL
yield(sql) if block_given?
sql = yield(sql) if block_given?
self.class.cohort_users(self).where("users.id IN (#{sql})").count
end
@ -272,7 +272,7 @@ SQL
count = _subquery(assoc_key = :jam_track_rights, num_user)
_put_data_set(assoc_key, count, num_user)
count = _subquery(assoc_key = :jam_tracks_played, num_user) do |subsql|
subsql += " AND tt.playable_type = 'JamRuby::JamTrack' "
end