my_forum 0.0.1.beta47 → 0.0.1.beta48
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 +4 -4
- data/app/models/my_forum/forum.rb +10 -14
- data/lib/my_forum/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a7013ef470e6fa60f3ed699a437a201a3f71232
|
4
|
+
data.tar.gz: 59013c7b8217eca43a2b863253ca1a8d6c995593
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 609f4f175e760199a842ffb5aac2dfa317aeb5641ffe2e614199db265cd7a8eabd024a52f15d40f663672974a47b7c18621357fa139f98f662c820eb4da661bf
|
7
|
+
data.tar.gz: 6320edd1026ee61daa9ddb51ada12df1a88c4716a512ec4ddd97510d98f6bb04f5e13d15aae179b1cd0794f85cab0bff122a8b9722d8d5eb2eb909c6ef290ba3
|
@@ -9,17 +9,11 @@ module MyForum
|
|
9
9
|
SELECT
|
10
10
|
my_forum_topics.name AS topic_name,
|
11
11
|
my_forum_topics.forum_id,
|
12
|
-
|
13
|
-
|
14
12
|
my_forum_topics.id,
|
15
13
|
my_forum_topics.latest_post_created_at AS post_created_at,
|
16
14
|
my_forum_topics.latest_post_login AS user_login
|
17
|
-
|
18
|
-
|
19
15
|
FROM my_forum_topics
|
20
|
-
|
21
16
|
WHERE my_forum_topics.forum_id = #{self.id}
|
22
|
-
|
23
17
|
LIMIT 1
|
24
18
|
").first
|
25
19
|
end
|
@@ -33,12 +27,13 @@ module MyForum
|
|
33
27
|
|
34
28
|
def topics_with_latest_post_info(page: 0, per_page: 30)
|
35
29
|
Topic.paginate_by_sql("
|
36
|
-
SELECT
|
30
|
+
SELECT
|
31
|
+
my_forum_topics.*,
|
32
|
+
my_forum_topics.latest_post_created_at AS last_post_time,
|
33
|
+
my_forum_topics.latest_post_login AS last_post_user_login
|
37
34
|
FROM my_forum_topics
|
38
|
-
JOIN my_forum_posts ON my_forum_posts.id = my_forum_topics.latest_post_id
|
39
|
-
JOIN my_forum_users ON my_forum_posts.user_id = my_forum_users.id
|
40
35
|
WHERE my_forum_topics.forum_id = #{self.id} AND my_forum_topics.deleted IS FALSE
|
41
|
-
ORDER BY my_forum_topics.pinned DESC
|
36
|
+
ORDER BY my_forum_topics.pinned DESC
|
42
37
|
", page: page, per_page: per_page)
|
43
38
|
end
|
44
39
|
|
@@ -47,12 +42,13 @@ module MyForum
|
|
47
42
|
log_topic_ids = [0] if log_topic_ids.empty?
|
48
43
|
|
49
44
|
Topic.paginate_by_sql("
|
50
|
-
SELECT
|
45
|
+
SELECT
|
46
|
+
my_forum_topics.*,
|
47
|
+
my_forum_topics.latest_post_created_at AS last_post_time,
|
48
|
+
my_forum_topics.latest_post_login AS last_post_user_login
|
51
49
|
FROM my_forum_topics
|
52
|
-
JOIN my_forum_posts ON my_forum_posts.id = my_forum_topics.latest_post_id
|
53
|
-
JOIN my_forum_users ON my_forum_posts.user_id = my_forum_users.id
|
54
50
|
WHERE my_forum_topics.id NOT IN (#{log_topic_ids.join(',')}) AND my_forum_topics.deleted IS FALSE
|
55
|
-
ORDER BY
|
51
|
+
ORDER BY my_forum_topics.id DESC
|
56
52
|
", page: page, per_page: per_page)
|
57
53
|
end
|
58
54
|
|
data/lib/my_forum/version.rb
CHANGED