my_forum 0.0.1.beta49 → 0.0.1.beta50
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/my_forum/forums_helper.rb +4 -4
- data/app/models/my_forum/forum.rb +14 -13
- 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: 01a6adf924404e2aa63c179b0825007047d3d7d1
|
4
|
+
data.tar.gz: 95ad8e6116a77456b338ea2d1400d6f57e4adba3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d36dfb8f08717e203a30bc349f388b86265e6df7e7430b7261ea078985e12670486c16d8b2c1f5cee888e69a513e58ad991869855633e173cb8ff6ac22b795c7
|
7
|
+
data.tar.gz: 9ca7e53d5ff302c5192cd368878636d99c00ed8cb6c8f0d28e69a3a676da7af4bff1c378cbc00d6d12bb23ed5a612b165d6dd04184e2e832a14ed5e9bc54897f
|
@@ -24,11 +24,11 @@ module MyForum
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def forum_last_message_info(forum)
|
27
|
-
|
27
|
+
topic = forum.topics.order('latest_post_created_at DESC').first
|
28
28
|
|
29
|
-
html = content_tag(:div,
|
30
|
-
html += content_tag(:div,
|
31
|
-
html += content_tag(:div,
|
29
|
+
html = content_tag(:div, topic ? (t('.last_answer_from') + topic.latest_post_login) : '-' )
|
30
|
+
html += content_tag(:div, topic ? (link_to((t('.in_forum') + topic.name), forum_topic_path(topic.forum_id, topic.id))) : '-' )
|
31
|
+
html += content_tag(:div, topic ? forum_time(topic.latest_post_created_at) : '-' )
|
32
32
|
|
33
33
|
html.html_safe
|
34
34
|
end
|
@@ -4,19 +4,20 @@ module MyForum
|
|
4
4
|
has_many :topics
|
5
5
|
has_many :posts
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
7
|
+
# TODO: Deprecated
|
8
|
+
# def latest_topic_info
|
9
|
+
# Topic.find_by_sql("
|
10
|
+
# SELECT
|
11
|
+
# my_forum_topics.name AS topic_name,
|
12
|
+
# my_forum_topics.forum_id,
|
13
|
+
# my_forum_topics.id,
|
14
|
+
# my_forum_topics.latest_post_created_at AS post_created_at,
|
15
|
+
# my_forum_topics.latest_post_login AS user_login
|
16
|
+
# FROM my_forum_topics
|
17
|
+
# WHERE my_forum_topics.forum_id = #{self.id}
|
18
|
+
# LIMIT 1
|
19
|
+
# ").first
|
20
|
+
# end
|
20
21
|
|
21
22
|
def has_unread_posts?(current_user)
|
22
23
|
latest_post_ids = self.topics.where('updated_at >= ?', current_user.created_at).pluck(:latest_post_id)
|
data/lib/my_forum/version.rb
CHANGED