thredded 0.13.0 → 0.13.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/app/assets/stylesheets/thredded/components/_onebox.scss +0 -9
  4. data/app/commands/thredded/create_messageboard.rb +3 -3
  5. data/app/commands/thredded/mark_all_read.rb +1 -1
  6. data/app/commands/thredded/notify_following_users.rb +3 -3
  7. data/app/commands/thredded/notify_private_topic_users.rb +1 -1
  8. data/app/controllers/concerns/thredded/new_post_params.rb +1 -1
  9. data/app/controllers/concerns/thredded/new_private_post_params.rb +1 -1
  10. data/app/controllers/thredded/application_controller.rb +1 -1
  11. data/app/controllers/thredded/autocomplete_users_controller.rb +1 -1
  12. data/app/controllers/thredded/messageboard_groups_controller.rb +2 -2
  13. data/app/controllers/thredded/messageboards_controller.rb +6 -6
  14. data/app/controllers/thredded/post_permalinks_controller.rb +1 -1
  15. data/app/controllers/thredded/post_previews_controller.rb +3 -3
  16. data/app/controllers/thredded/posts_controller.rb +8 -4
  17. data/app/controllers/thredded/preferences_controller.rb +2 -2
  18. data/app/controllers/thredded/private_post_permalinks_controller.rb +1 -1
  19. data/app/controllers/thredded/private_post_previews_controller.rb +3 -3
  20. data/app/controllers/thredded/private_posts_controller.rb +4 -4
  21. data/app/controllers/thredded/private_topic_previews_controller.rb +1 -1
  22. data/app/controllers/thredded/read_states_controller.rb +1 -1
  23. data/app/controllers/thredded/theme_previews_controller.rb +23 -23
  24. data/app/controllers/thredded/topic_previews_controller.rb +1 -1
  25. data/app/forms/thredded/private_topic_form.rb +1 -1
  26. data/app/forms/thredded/topic_form.rb +2 -2
  27. data/app/forms/thredded/user_preferences_form.rb +2 -2
  28. data/app/helpers/thredded/render_helper.rb +1 -1
  29. data/app/jobs/thredded/auto_follow_and_notify_job.rb +3 -3
  30. data/app/mailer_previews/thredded/base_mailer_preview.rb +5 -5
  31. data/app/models/concerns/thredded/content_moderation_state.rb +1 -1
  32. data/app/models/thredded/topic.rb +1 -1
  33. data/app/view_models/thredded/private_topic_view.rb +1 -1
  34. data/lib/thredded/version.rb +1 -1
  35. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 633ce6690d9ffc55e74596d44c9c6547778700e6
4
- data.tar.gz: ab7417716f223e806bf189263da331ebe9b1635f
3
+ metadata.gz: 32e322d5d5558536a3d2c8fe7e7a196609cf71a8
4
+ data.tar.gz: f36491bb09330badf3459491b778b36f60b54354
5
5
  SHA512:
6
- metadata.gz: a513cd6fd50b5b1e3dc4f3af5a3d81719b942df9ef66f27f32c9e874ea1784ec39bd41752c94694bdf80b59fa24b1d203dcb31322d7294f43d1aefd79781197a
7
- data.tar.gz: 6ff341b70414e6fdbcb79faf28c97290dae8cedb4be683171ef33fad0453d7b3ac012447d535f460d12cb52f9f3b01a6dfcc09a02f2b875237d56baab00479e1
6
+ metadata.gz: 17e1a22e90d820c73911e33531a244123f6780c7c4c0f762b5e57af2f415f1bcf52cedada265d843cf5d5dfee747f1c026e5baf5edae5c3935933b718bbf5072
7
+ data.tar.gz: 05b99051bcbd7cdc52917e38033d4733f5e7444210e0151aadd1671660a276a100fd28cc15727cc0f2858ee8e4eb6b83fa963ca287771c9ba5514ac781af004c
data/README.md CHANGED
@@ -98,7 +98,7 @@ Then, see the rest of this Readme for more information about using and customizi
98
98
  Add the gem to your Gemfile:
99
99
 
100
100
  ```ruby
101
- gem 'thredded', '~> 0.13.0'
101
+ gem 'thredded', '~> 0.13.1'
102
102
  ```
103
103
 
104
104
  Add the Thredded [initializer] to your parent app by running the install generator.
@@ -195,15 +195,6 @@ pre.onebox code {
195
195
  }
196
196
  }
197
197
 
198
- // Onebox - Google Maps
199
- .maps-onebox {
200
- // The onebox gem adds a div with inline styles that breaks mobile
201
- // Hide the div
202
- > div:first-child {
203
- display: none;
204
- }
205
- }
206
-
207
198
  // Onebox - Twitter - Status
208
199
  aside.onebox.twitterstatus .onebox-body {
209
200
  h4 {
@@ -12,14 +12,14 @@ module Thredded
12
12
 
13
13
  # @return [boolean] true if the messageboard was created and seeded with a topic successfully.
14
14
  def run
15
- Messageboard.transaction do
15
+ Thredded::Messageboard.transaction do
16
16
  fail ActiveRecord::Rollback unless @messageboard.save
17
- topic = Topic.create!(
17
+ topic = Thredded::Topic.create!(
18
18
  messageboard: @messageboard,
19
19
  user: @user,
20
20
  title: first_topic_title
21
21
  )
22
- Post.create!(
22
+ Thredded::Post.create!(
23
23
  messageboard: @messageboard,
24
24
  user: @user,
25
25
  postable: topic,
@@ -10,7 +10,7 @@ module Thredded
10
10
  last_post = topic.posts.order_oldest_first.last
11
11
  total_pages = topic.posts.page(1).total_pages
12
12
 
13
- UserPrivateTopicReadState.touch!(
13
+ Thredded::UserPrivateTopicReadState.touch!(
14
14
  user.id,
15
15
  topic.id,
16
16
  last_post,
@@ -31,9 +31,9 @@ module Thredded
31
31
 
32
32
  def users_subscribed_via(notifier)
33
33
  subscribed_users.select do |user|
34
- NotificationsForFollowedTopics
34
+ Thredded::NotificationsForFollowedTopics
35
35
  .detect_or_default(user.thredded_notifications_for_followed_topics, notifier).enabled? &&
36
- MessageboardNotificationsForFollowedTopics
36
+ Thredded::MessageboardNotificationsForFollowedTopics
37
37
  .detect_or_default(messageboard_notifier_prefs_by_user_id[user.id], notifier).enabled?
38
38
  end
39
39
  end
@@ -52,7 +52,7 @@ module Thredded
52
52
  private
53
53
 
54
54
  def messageboard_notifier_prefs_by_user_id
55
- @messageboard_notifier_prefs_by_user_id ||= MessageboardNotificationsForFollowedTopics
55
+ @messageboard_notifier_prefs_by_user_id ||= Thredded::MessageboardNotificationsForFollowedTopics
56
56
  .where(user_id: subscribed_users.map(&:id))
57
57
  .for_messageboard(@post.messageboard).group_by(&:user_id)
58
58
  end
@@ -26,7 +26,7 @@ module Thredded
26
26
 
27
27
  def only_those_with_this_notifier_enabled(users, notifier)
28
28
  users.select do |user|
29
- NotificationsForPrivateTopics
29
+ Thredded::NotificationsForPrivateTopics
30
30
  .detect_or_default(user.thredded_notifications_for_private_topics, notifier).enabled?
31
31
  end
32
32
  end
@@ -11,7 +11,7 @@ module Thredded
11
11
  .merge(ip: request.remote_ip).tap do |p|
12
12
  quote_id = p.delete(:quote_post_id)
13
13
  if quote_id
14
- post = Post.find(quote_id)
14
+ post = Thredded::Post.find(quote_id)
15
15
  authorize_reading post
16
16
  p[:quote_post] = post
17
17
  end
@@ -11,7 +11,7 @@ module Thredded
11
11
  .merge(ip: request.remote_ip).tap do |p|
12
12
  quote_id = p.delete(:quote_private_post_id)
13
13
  if quote_id
14
- post = PrivatePost.find(quote_id)
14
+ post = Thredded::PrivatePost.find(quote_id)
15
15
  authorize_reading post
16
16
  p[:quote_post] = post
17
17
  end
@@ -105,7 +105,7 @@ module Thredded
105
105
  # @return [Thredded::Messageboard]
106
106
  # @raise [Thredded::Errors::MessageboardNotFound] if the messageboard with the given slug does not exist.
107
107
  def messageboard
108
- @messageboard ||= Messageboard.friendly_find!(params[:messageboard_id])
108
+ @messageboard ||= Thredded::Messageboard.friendly_find!(params[:messageboard_id])
109
109
  end
110
110
 
111
111
  def messageboard_or_nil
@@ -5,7 +5,7 @@ module Thredded
5
5
  MAX_RESULTS = 20
6
6
 
7
7
  def index
8
- authorize_creating PrivateTopicForm.new(user: thredded_current_user).private_topic
8
+ authorize_creating Thredded::PrivateTopicForm.new(user: thredded_current_user).private_topic
9
9
  users = params.key?(:q) ? users_by_prefix : users_by_ids
10
10
  render json: {
11
11
  results: users.map do |user|
@@ -3,12 +3,12 @@
3
3
  module Thredded
4
4
  class MessageboardGroupsController < Thredded::ApplicationController
5
5
  def new
6
- @messageboard_group = MessageboardGroup.new
6
+ @messageboard_group = Thredded::MessageboardGroup.new
7
7
  authorize @messageboard_group, :create?
8
8
  end
9
9
 
10
10
  def create
11
- @messageboard_group = MessageboardGroup.new(messageboard_group_params)
11
+ @messageboard_group = Thredded::MessageboardGroup.new(messageboard_group_params)
12
12
  authorize @messageboard_group, :create?
13
13
 
14
14
  if @messageboard_group.save
@@ -8,17 +8,17 @@ module Thredded
8
8
  after_action :verify_policy_scoped, except: %i[new create edit update]
9
9
 
10
10
  def index
11
- @groups = MessageboardGroupView.grouped(policy_scope(Messageboard.all))
11
+ @groups = Thredded::MessageboardGroupView.grouped(policy_scope(Thredded::Messageboard.all))
12
12
  end
13
13
 
14
14
  def new
15
- @messageboard = Messageboard.new
16
- @messageboard_group = MessageboardGroup.all
15
+ @messageboard = Thredded::Messageboard.new
16
+ @messageboard_group = Thredded::MessageboardGroup.all
17
17
  authorize_creating @messageboard
18
18
  end
19
19
 
20
20
  def create
21
- @messageboard = Messageboard.new(messageboard_params)
21
+ @messageboard = Thredded::Messageboard.new(messageboard_params)
22
22
  authorize_creating @messageboard
23
23
  if Thredded::CreateMessageboard.new(@messageboard, thredded_current_user).run
24
24
  redirect_to root_path
@@ -28,12 +28,12 @@ module Thredded
28
28
  end
29
29
 
30
30
  def edit
31
- @messageboard = Messageboard.friendly_find!(params[:id])
31
+ @messageboard = Thredded::Messageboard.friendly_find!(params[:id])
32
32
  authorize @messageboard, :update?
33
33
  end
34
34
 
35
35
  def update
36
- @messageboard = Messageboard.friendly_find!(params[:id])
36
+ @messageboard = Thredded::Messageboard.friendly_find!(params[:id])
37
37
  authorize @messageboard, :update?
38
38
  if @messageboard.update(messageboard_params)
39
39
  redirect_to messageboard_topics_path(@messageboard), notice: I18n.t('thredded.messageboard.updated_notice')
@@ -3,7 +3,7 @@
3
3
  module Thredded
4
4
  class PostPermalinksController < Thredded::ApplicationController
5
5
  def show
6
- post = Post.find(params[:id])
6
+ post = Thredded::Post.find(params[:id])
7
7
  authorize post, :read?
8
8
  redirect_to post_url(post, user: thredded_current_user), status: :found
9
9
  end
@@ -6,14 +6,14 @@ module Thredded
6
6
 
7
7
  # Preview a new post
8
8
  def preview
9
- @post = Post.new(post_params)
10
- @post.postable = Topic.friendly_find!(params[:topic_id])
9
+ @post = Thredded::Post.new(post_params)
10
+ @post.postable = Thredded::Topic.friendly_find!(params[:topic_id])
11
11
  render_preview
12
12
  end
13
13
 
14
14
  # Preview an update to an existing post
15
15
  def update
16
- @post = Post.find(params[:post_id])
16
+ @post = Thredded::Post.find(params[:post_id])
17
17
  @post.assign_attributes(post_params)
18
18
  render_preview
19
19
  end
@@ -12,12 +12,16 @@ module Thredded
12
12
  after_action :verify_authorized
13
13
 
14
14
  def new
15
- @post_form = PostForm.new(user: thredded_current_user, topic: parent_topic, post_params: new_post_params)
15
+ @post_form = Thredded::PostForm.new(
16
+ user: thredded_current_user, topic: parent_topic, post_params: new_post_params
17
+ )
16
18
  authorize_creating @post_form.post
17
19
  end
18
20
 
19
21
  def create
20
- @post_form = PostForm.new(user: thredded_current_user, topic: parent_topic, post_params: new_post_params)
22
+ @post_form = Thredded::PostForm.new(
23
+ user: thredded_current_user, topic: parent_topic, post_params: new_post_params
24
+ )
21
25
  authorize_creating @post_form.post
22
26
 
23
27
  if @post_form.save
@@ -28,7 +32,7 @@ module Thredded
28
32
  end
29
33
 
30
34
  def edit
31
- @post_form = PostForm.for_persisted(post)
35
+ @post_form = Thredded::PostForm.for_persisted(post)
32
36
  authorize @post_form.post, :update?
33
37
  return redirect_to(canonical_topic_params) unless params_match?(canonical_topic_params)
34
38
  render
@@ -76,7 +80,7 @@ module Thredded
76
80
  end
77
81
 
78
82
  def parent_topic
79
- Topic
83
+ Thredded::Topic
80
84
  .where(messageboard: messageboard)
81
85
  .friendly
82
86
  .find(params[:topic_id])
@@ -19,10 +19,10 @@ module Thredded
19
19
  private
20
20
 
21
21
  def init_preferences
22
- @preferences = UserPreferencesForm.new(
22
+ @preferences = Thredded::UserPreferencesForm.new(
23
23
  user: thredded_current_user,
24
24
  messageboard: messageboard_or_nil,
25
- messageboards: policy_scope(Messageboard.all),
25
+ messageboards: policy_scope(Thredded::Messageboard.all),
26
26
  params: preferences_params
27
27
  )
28
28
  end
@@ -4,7 +4,7 @@ module Thredded
4
4
  class PrivatePostPermalinksController < Thredded::ApplicationController
5
5
  before_action :thredded_require_login!
6
6
  def show
7
- private_post = PrivatePost.find(params[:id])
7
+ private_post = Thredded::PrivatePost.find(params[:id])
8
8
  authorize private_post, :read?
9
9
  redirect_to post_url(private_post, user: thredded_current_user), status: :found
10
10
  end
@@ -6,14 +6,14 @@ module Thredded
6
6
 
7
7
  # Preview a new post
8
8
  def preview
9
- @private_post = PrivatePost.new(private_post_params)
10
- @private_post.postable = PrivateTopic.friendly_find!(params[:private_topic_id])
9
+ @private_post = Thredded::PrivatePost.new(private_post_params)
10
+ @private_post.postable = Thredded::PrivateTopic.friendly_find!(params[:private_topic_id])
11
11
  render_preview
12
12
  end
13
13
 
14
14
  # Preview an update to an existing post
15
15
  def update
16
- @private_post = PrivatePost.find(params[:private_post_id])
16
+ @private_post = Thredded::PrivatePost.find(params[:private_post_id])
17
17
  @private_post.assign_attributes(private_post_params)
18
18
  render_preview
19
19
  end
@@ -12,14 +12,14 @@ module Thredded
12
12
  after_action :verify_authorized
13
13
 
14
14
  def new
15
- @post_form = PrivatePostForm.new(
15
+ @post_form = Thredded::PrivatePostForm.new(
16
16
  user: thredded_current_user, topic: parent_topic, post_params: new_private_post_params
17
17
  )
18
18
  authorize_creating @post_form.post
19
19
  end
20
20
 
21
21
  def create
22
- @post_form = PrivatePostForm.new(
22
+ @post_form = Thredded::PrivatePostForm.new(
23
23
  user: thredded_current_user, topic: parent_topic, post_params: new_private_post_params
24
24
  )
25
25
  authorize_creating @post_form.post
@@ -31,7 +31,7 @@ module Thredded
31
31
  end
32
32
 
33
33
  def edit
34
- @post_form = PrivatePostForm.for_persisted(post)
34
+ @post_form = Thredded::PrivatePostForm.for_persisted(post)
35
35
  authorize @post_form.post, :update?
36
36
  return redirect_to(canonical_topic_params) unless params_match?(canonical_topic_params)
37
37
  render
@@ -79,7 +79,7 @@ module Thredded
79
79
  end
80
80
 
81
81
  def parent_topic
82
- PrivateTopic
82
+ Thredded::PrivateTopic
83
83
  .includes(:private_users)
84
84
  .friendly
85
85
  .find(params[:private_topic_id])
@@ -6,7 +6,7 @@ module Thredded
6
6
  include Thredded::RenderPreview
7
7
 
8
8
  def preview
9
- form = PrivateTopicForm.new(new_private_topic_params)
9
+ form = Thredded::PrivateTopicForm.new(new_private_topic_params)
10
10
  @private_post = form.post
11
11
  @private_post.postable = form.private_topic
12
12
  render_preview
@@ -5,7 +5,7 @@ module Thredded
5
5
  before_action :thredded_require_login!
6
6
 
7
7
  def update
8
- MarkAllRead.run(thredded_current_user) if thredded_signed_in?
8
+ Thredded::MarkAllRead.run(thredded_current_user) if thredded_signed_in?
9
9
 
10
10
  redirect_to request.referer
11
11
  end
@@ -3,32 +3,32 @@
3
3
  module Thredded
4
4
  class ThemePreviewsController < Thredded::ApplicationController
5
5
  def show # rubocop:disable Metrics/MethodLength
6
- @messageboard = Messageboard.first
6
+ @messageboard = Thredded::Messageboard.first
7
7
  fail Thredded::Errors::DatabaseEmpty unless @messageboard
8
- @user = if thredded_current_user.thredded_anonymous?
9
- Thredded.user_class.new(id: 1334, name: 'joe', email: 'joe@example.com')
10
- else
11
- thredded_current_user
12
- end
13
- @messageboards = Messageboard.all
14
- @topics = TopicsPageView.new(@user, @messageboard.topics.page(1).limit(3))
15
- @private_topics = PrivateTopicsPageView.new(@user, @user.thredded_private_topics.page(1).limit(3))
16
- topic = Topic.new(messageboard: @messageboard, title: 'Hello', slug: 'hello', user: @user)
17
- @topic = TopicView.from_user(topic, @user)
18
- @posts = TopicPostsPageView.new(@user, topic, topic.posts.page(1).limit(3))
19
- @post = topic.posts.build(id: 1337, postable: topic, content: 'Hello world', user: @user)
20
- @post_form = PostForm.for_persisted(@post)
21
- @new_post = PostForm.new(user: @user, topic: topic)
22
- @new_topic = TopicForm.new(user: @user, messageboard: @messageboard)
23
- @new_private_topic = PrivateTopicForm.new(user: @user)
24
- private_topic = PrivateTopic.new(id: 1337, title: 'Hello', user: @user, last_user: @user, users: [@user])
25
- @private_topic = PrivateTopicView.from_user(private_topic, @user)
26
- @private_posts = TopicPostsPageView.new(@user, private_topic, private_topic.posts.page(1).limit(3))
27
- @private_post = private_topic.posts.build(
8
+ @user = if thredded_current_user.thredded_anonymous?
9
+ Thredded.user_class.new(id: 1334, name: 'joe', email: 'joe@example.com')
10
+ else
11
+ thredded_current_user
12
+ end
13
+ @messageboards = Thredded::Messageboard.all
14
+ @topics = Thredded::TopicsPageView.new(@user, @messageboard.topics.page(1).limit(3))
15
+ @private_topics = Thredded::PrivateTopicsPageView.new(@user, @user.thredded_private_topics.page(1).limit(3))
16
+ topic = Thredded::Topic.new(messageboard: @messageboard, title: 'Hello', slug: 'hello', user: @user)
17
+ @topic = Thredded::TopicView.from_user(topic, @user)
18
+ @posts = Thredded::TopicPostsPageView.new(@user, topic, topic.posts.page(1).limit(3))
19
+ @post = topic.posts.build(id: 1337, postable: topic, content: 'Hello world', user: @user)
20
+ @post_form = Thredded::PostForm.for_persisted(@post)
21
+ @new_post = Thredded::PostForm.new(user: @user, topic: topic)
22
+ @new_topic = Thredded::TopicForm.new(user: @user, messageboard: @messageboard)
23
+ @new_private_topic = Thredded::PrivateTopicForm.new(user: @user)
24
+ private_topic = Thredded::PrivateTopic.new(id: 17, title: 'Hello', user: @user, last_user: @user, users: [@user])
25
+ @private_topic = Thredded::PrivateTopicView.from_user(private_topic, @user)
26
+ @private_posts = Thredded::TopicPostsPageView.new(@user, private_topic, private_topic.posts.page(1).limit(3))
27
+ @private_post = private_topic.posts.build(
28
28
  id: 1337, postable: private_topic, content: 'A private hello world', user: @user
29
29
  )
30
- @private_post_form = PrivatePostForm.for_persisted(@private_post)
31
- @preferences = UserPreferencesForm.new(user: @user, messageboard: @messageboard)
30
+ @private_post_form = Thredded::PrivatePostForm.for_persisted(@private_post)
31
+ @preferences = Thredded::UserPreferencesForm.new(user: @user, messageboard: @messageboard)
32
32
  end
33
33
  end
34
34
  end
@@ -6,7 +6,7 @@ module Thredded
6
6
  include Thredded::RenderPreview
7
7
 
8
8
  def preview
9
- form = TopicForm.new(new_topic_params)
9
+ form = Thredded::TopicForm.new(new_topic_params)
10
10
  @post = form.post
11
11
  @post.postable = form.topic
12
12
  render_preview
@@ -89,7 +89,7 @@ module Thredded
89
89
  def topic_categories
90
90
  if category_ids
91
91
  ids = category_ids.reject(&:empty?)
92
- Category.where(id: ids)
92
+ Thredded::Category.where(id: ids)
93
93
  else
94
94
  []
95
95
  end
@@ -33,7 +33,7 @@ module Thredded
33
33
  ActiveRecord::Base.transaction do
34
34
  topic.save!
35
35
  post.save!
36
- UserTopicReadState.read_on_first_post!(user, topic) if topic.previous_changes.include?(:id)
36
+ Thredded::UserTopicReadState.read_on_first_post!(user, topic) if topic.previous_changes.include?(:id)
37
37
  end
38
38
  true
39
39
  end
@@ -75,7 +75,7 @@ module Thredded
75
75
  def topic_categories
76
76
  if category_ids
77
77
  ids = category_ids.reject(&:empty?)
78
- Category.where(id: ids)
78
+ Thredded::Category.where(id: ids)
79
79
  else
80
80
  []
81
81
  end
@@ -39,7 +39,7 @@ module Thredded
39
39
 
40
40
  # Update all of the messageboards' auto_follow_topics if the global preference has changed.
41
41
  if user_preference.previous_changes.include?('auto_follow_topics')
42
- UserMessageboardPreference.where(user: @user)
42
+ Thredded::UserMessageboardPreference.where(user: @user)
43
43
  .update_all(auto_follow_topics: user_preference.auto_follow_topics)
44
44
  user_messageboard_preference.auto_follow_topics_will_change! if messageboard
45
45
  end
@@ -50,7 +50,7 @@ module Thredded
50
50
  end
51
51
 
52
52
  def messageboard_groups
53
- @messageboard_groups ||= MessageboardGroupView.grouped(@messageboards)
53
+ @messageboard_groups ||= Thredded::MessageboardGroupView.grouped(@messageboards)
54
54
  end
55
55
 
56
56
  def notifications_for_private_topics
@@ -7,7 +7,7 @@ module Thredded
7
7
  # @param expires_in [ActiveSupport::Duration]
8
8
  # @return Array<[T, String]>
9
9
  def render_collection_to_strings_with_cache(collection:, partial:, expires_in:, **opts)
10
- CollectionToStringsWithCacheRenderer.new(lookup_context).render_collection_to_strings_with_cache(
10
+ Thredded::CollectionToStringsWithCacheRenderer.new(lookup_context).render_collection_to_strings_with_cache(
11
11
  self, collection: collection, partial: partial, expires_in: expires_in, **opts
12
12
  )
13
13
  end
@@ -5,10 +5,10 @@ module Thredded
5
5
  queue_as :default
6
6
 
7
7
  def perform(post_id)
8
- post = Post.find(post_id)
8
+ post = Thredded::Post.find(post_id)
9
9
 
10
- AutofollowUsers.new(post).run
11
- NotifyFollowingUsers.new(post).run
10
+ Thredded::AutofollowUsers.new(post).run
11
+ Thredded::NotifyFollowingUsers.new(post).run
12
12
  end
13
13
  end
14
14
  end
@@ -23,7 +23,7 @@ Additionally, Markdown is extended to support the following:
23
23
 
24
24
  def mock_topic(attr = {})
25
25
  fail 'Do not assign ID here or a has_many association might get updated' if attr.key?(:id)
26
- Topic.new(
26
+ Thredded::Topic.new(
27
27
  attr.reverse_merge(
28
28
  title: 'A test topic',
29
29
  slug: 'a-test-topic',
@@ -41,7 +41,7 @@ Additionally, Markdown is extended to support the following:
41
41
 
42
42
  def mock_post(attr = {})
43
43
  topic = attr[:postable] || mock_topic
44
- Post.new(
44
+ Thredded::Post.new(
45
45
  attr.reverse_merge(
46
46
  content: 'A test post',
47
47
  created_at: Time.zone.now,
@@ -56,7 +56,7 @@ Additionally, Markdown is extended to support the following:
56
56
 
57
57
  def mock_private_topic(attr = {})
58
58
  fail 'Do not assign ID here or a has_many association might get updated' if attr.key?(:id)
59
- PrivateTopic.new(
59
+ Thredded::PrivateTopic.new(
60
60
  attr.reverse_merge(
61
61
  title: 'A test private topic',
62
62
  slug: 'a-test-private-topic',
@@ -71,7 +71,7 @@ Additionally, Markdown is extended to support the following:
71
71
 
72
72
  def mock_private_post(attr = {})
73
73
  private_topic = attr[:postable] || mock_private_topic
74
- PrivatePost.new(
74
+ Thredded::PrivatePost.new(
75
75
  attr.reverse_merge(
76
76
  content: 'A test private post',
77
77
  created_at: Time.zone.now,
@@ -85,7 +85,7 @@ Additionally, Markdown is extended to support the following:
85
85
 
86
86
  def mock_messageboard(attr = {})
87
87
  fail 'Do not assign ID here or a has_many association might get updated' if attr.key?(:id)
88
- Messageboard.new(
88
+ Thredded::Messageboard.new(
89
89
  attr.reverse_merge(
90
90
  name: 'A test messageboard',
91
91
  slug: 'a-test-messageboard',
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Thredded
4
- # Moderation state of a piece of content, such as a Topic or a Post.
4
+ # Moderation state of a piece of content, such as a Thredded::Topic or a Thredded::Post.
5
5
  # Requires an integer moderation_state column, a user_id column, and a user_detail association on the including class.
6
6
  # @api private
7
7
  module ContentModerationState
@@ -172,7 +172,7 @@ module Thredded
172
172
  # Update the associated messageboard metadata that Rails does not update them automatically.
173
173
  previous_changes['messageboard_id'].each do |messageboard_id|
174
174
  Thredded::Messageboard.reset_counters(messageboard_id, :topics, :posts)
175
- Messageboard.find(messageboard_id).update_last_topic!
175
+ Thredded::Messageboard.find(messageboard_id).update_last_topic!
176
176
  end
177
177
  end
178
178
  end
@@ -11,7 +11,7 @@ module Thredded
11
11
 
12
12
  def self.from_user(topic, user)
13
13
  read_state = if user && !user.thredded_anonymous?
14
- UserPrivateTopicReadState
14
+ Thredded::UserPrivateTopicReadState
15
15
  .find_by(user_id: user.id, postable_id: topic.id)
16
16
  end
17
17
  new(topic, read_state, Pundit.policy!(user, topic))
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Thredded
4
- VERSION = '0.13.0'
4
+ VERSION = '0.13.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thredded
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.13.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Oliveira
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-06-10 00:00:00.000000000 Z
12
+ date: 2017-06-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: pundit
@@ -174,7 +174,7 @@ dependencies:
174
174
  version: '1.8'
175
175
  - - ">="
176
176
  - !ruby/object:Gem::Version
177
- version: 1.8.3
177
+ version: 1.8.13
178
178
  type: :runtime
179
179
  prerelease: false
180
180
  version_requirements: !ruby/object:Gem::Requirement
@@ -184,7 +184,7 @@ dependencies:
184
184
  version: '1.8'
185
185
  - - ">="
186
186
  - !ruby/object:Gem::Version
187
- version: 1.8.3
187
+ version: 1.8.13
188
188
  - !ruby/object:Gem::Dependency
189
189
  name: html-pipeline
190
190
  requirement: !ruby/object:Gem::Requirement