thredded 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63f6eebe937c5b969d191a5650bb160b07b5976a
|
4
|
+
data.tar.gz: 73b1e243259935e0f8e80a653ffe4c922e581e28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f38401e4c39f48e55dd2def77978ab913d662a13012de3e013fd0f67d4fd62bf7df03bc259cb5e933442ca6234aed36537e2a45ddfa04e3a03b97dc4d2793825
|
7
|
+
data.tar.gz: 718c48c5501ecb3712ae25c7113bdcf457de3eb6cc1a72fce282a825c9dd5644a548ecd5d1da3667cec8b41c5cb1219a2b1aa791cf83566c960a758620517198
|
@@ -4,14 +4,14 @@ module Thredded
|
|
4
4
|
if cannot? :read, messageboard
|
5
5
|
error = 'You are not authorized access to this messageboard.'
|
6
6
|
redirect_to default_home, flash: { error: error }
|
7
|
-
else
|
8
|
-
@private_topics = private_topics
|
9
7
|
end
|
8
|
+
|
9
|
+
@private_topics = private_topics
|
10
10
|
end
|
11
11
|
|
12
12
|
def new
|
13
13
|
@private_topic = messageboard.private_topics.build
|
14
|
-
@private_topic.posts.build
|
14
|
+
@private_topic.posts.build
|
15
15
|
|
16
16
|
unless can? :create, @private_topic
|
17
17
|
error = 'Sorry, you are not authorized to post on this messageboard.'
|
@@ -21,9 +21,8 @@ module Thredded
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def create
|
24
|
-
|
25
|
-
|
26
|
-
@private_topic = PrivateTopic.create(params[:topic])
|
24
|
+
@private_topic = messageboard.private_topics.create(private_topics_params)
|
25
|
+
|
27
26
|
redirect_to messageboard_topics_url(messageboard)
|
28
27
|
end
|
29
28
|
|
@@ -35,5 +34,25 @@ module Thredded
|
|
35
34
|
.order_by_stuck_and_updated_time
|
36
35
|
.on_page(params[:page])
|
37
36
|
end
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
def private_topics_params
|
41
|
+
params[:topic][:user_id] << current_user.id
|
42
|
+
|
43
|
+
params
|
44
|
+
.require(:topic)
|
45
|
+
.permit!
|
46
|
+
.deep_merge!({
|
47
|
+
user: current_user,
|
48
|
+
last_user: current_user,
|
49
|
+
posts_attributes: {
|
50
|
+
'0' => {
|
51
|
+
messageboard: messageboard,
|
52
|
+
user: current_user,
|
53
|
+
}
|
54
|
+
}
|
55
|
+
})
|
56
|
+
end
|
38
57
|
end
|
39
58
|
end
|
data/lib/thredded/version.rb
CHANGED