my_forum 0.0.1.beta10 → 0.0.1.beta11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca2f4cc6c92e956d1eb65f087ec097dcfa75e1be
4
- data.tar.gz: 83284a04c8fd6d60b80c23ed8f02ac20b01238ba
3
+ metadata.gz: 10dad8230912925baaba5dff380a7a4cfa2fc5aa
4
+ data.tar.gz: 5bb4b627be10719f631772901c843b6b49cc1b6d
5
5
  SHA512:
6
- metadata.gz: 0bcf40a3b22e90b5d388b8675d4e99d505bae890e4cc84d8e036b7edd51c65e17ce7dab123896a47cb1602786b2ac8778cc872cfc6e845f334fd8a3cd3164661
7
- data.tar.gz: 12dad4892a20fae8953aed8e2b1e72a91e23164b17c8f8bfa796a45aeeea8b690e2d82c62e8030cd0aac1add632750298d7d84f7b459b9fc9a0edb9f2bbe8677
6
+ metadata.gz: 7b78a8580264fc0076fd049a34b091a98f502f4b647701b3c507793eaad781006fa476bbba136dcd4bbc96faaef3c31a0c4ce1736d122f35a2ef7814982a6c6e
7
+ data.tar.gz: 9f09fcc47d28248981bde6129d583d6dcc50b6e2120f0f82588a9718cb895aa63f936b2273634ae2c3c5d679b851e45243f7236685dae20ad5a121eca91018af
@@ -11,12 +11,16 @@ module MyForum
11
11
 
12
12
  # Don`r forget permissions
13
13
  available_forum_ids = MyForum::Forum.where(category_id: @forum_categories.map(&:id)).pluck(:id)
14
- @recent_topics = Topic.find_by_sql("
15
- SELECT my_forum_topics.* FROM my_forum_topics
16
- JOIN my_forum_forums ON my_forum_forums.id = my_forum_topics.forum_id
17
- WHERE my_forum_forums.id IN (#{available_forum_ids.join(',')})
18
- ORDER BY my_forum_topics.updated_at DESC limit 10
19
- ") || []
14
+ @recent_topics = if available_forum_ids.blank?
15
+ []
16
+ else
17
+ Topic.find_by_sql("
18
+ SELECT my_forum_topics.* FROM my_forum_topics
19
+ JOIN my_forum_forums ON my_forum_forums.id = my_forum_topics.forum_id
20
+ WHERE my_forum_forums.id IN (#{available_forum_ids.join(',')})
21
+ ORDER BY my_forum_topics.updated_at DESC limit 10
22
+ ")
23
+ end
20
24
 
21
25
  end
22
26
  end
@@ -1,3 +1,3 @@
1
1
  module MyForum
2
- VERSION = "0.0.1.beta10"
2
+ VERSION = "0.0.1.beta11"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: my_forum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.beta10
4
+ version: 0.0.1.beta11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vitaly Omelchenko