Commit 083eca4e906b686dd7ea07c5260219ca4260e2b8
1 parent
50a53370
Exists in
master
and in
29 other branches
Fixing enterprise activities crash on postgres
(ActionItem2668)
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
app/models/enterprise.rb
... | ... | @@ -182,7 +182,7 @@ class Enterprise < Organization |
182 | 182 | end |
183 | 183 | |
184 | 184 | def activities |
185 | - Scrap.find_by_sql("SELECT id, updated_at, 'Scrap' AS klass FROM scraps WHERE scraps.receiver_id = #{self.id} AND scraps.scrap_id IS NULL UNION SELECT id, updated_at, 'ActionTracker::Record' AS klass FROM action_tracker WHERE action_tracker.target_id = #{self.id} UNION SELECT action_tracker.id, action_tracker.updated_at, 'ActionTracker::Record' AS klass FROM action_tracker INNER JOIN articles ON action_tracker.target_id = articles.id WHERE articles.profile_id = #{self.id} AND action_tracker.target_type = 'Article' ORDER BY action_tracker.updated_at DESC") | |
185 | + Scrap.find_by_sql("SELECT id, updated_at, 'Scrap' AS klass FROM scraps WHERE scraps.receiver_id = #{self.id} AND scraps.scrap_id IS NULL UNION SELECT id, updated_at, 'ActionTracker::Record' AS klass FROM action_tracker WHERE action_tracker.target_id = #{self.id} UNION SELECT action_tracker.id, action_tracker.updated_at, 'ActionTracker::Record' AS klass FROM action_tracker INNER JOIN articles ON action_tracker.target_id = articles.id WHERE articles.profile_id = #{self.id} AND action_tracker.target_type = 'Article' ORDER BY updated_at DESC") | |
186 | 186 | end |
187 | 187 | |
188 | 188 | def catalog_url | ... | ... |