thredded 0.16.10 → 0.16.11

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
  SHA256:
3
- metadata.gz: 78b0d8ea36cff88b87fc05f44d4419af0872e6f2c6747fc316df5b010d1affd3
4
- data.tar.gz: 5f82a2fdc6c287cd85cb3dd3a5ef12631e5227dfbef4ab2d68c7495c990bf523
3
+ metadata.gz: 741784943db6fb342733ffb31a72839b04f50c11f73800ac6ef12e4a69eb61a8
4
+ data.tar.gz: de850a7928e05f2d97990b918fe5fddf684859087fda119e6511f344ea385fc8
5
5
  SHA512:
6
- metadata.gz: ec6c4e0b3ec14274519dcff925d6f10c3de0721de4dd074fd44ba193e682e178d1fabe3253e026bdc6cbdf53d13933675f39dbe61e308a8edb5af540930ade5c
7
- data.tar.gz: befd728ca48d0a7c9313850fd1297f1afe9a1f52e73b960ad1b35b044484f131f0c2d9e7713cbc62dc453b45ba4888ec6a19872424071ddc67f83be03715fa83
6
+ metadata.gz: bf23cc3d905ba1ab460bab9a0fd40babfb4bdccac806bc299a3100cf9550b7d80b5d0c948cfe7493997fef773a3260cca3449ff46360cd3ff66c2a63dd3c03a6
7
+ data.tar.gz: 155e6a9079c65c33008d91a9bf5def441dd7f5d78021d6656ee2d2625248e6d0bf01f773107b871000b917e9fbd39d5a0bc653f18953807d37a4a8779c223af7
data/README.md CHANGED
@@ -95,7 +95,7 @@ Then, see the rest of this Readme for more information about using and customizi
95
95
  Add the gem to your Gemfile:
96
96
 
97
97
  ```ruby
98
- gem 'thredded', '~> 0.16.10'
98
+ gem 'thredded', '~> 0.16.11'
99
99
  ```
100
100
 
101
101
  Add the Thredded [initializer] to your parent app by running the install generator.
@@ -368,7 +368,7 @@ for a team messageboard or a company announcements board, for example. To enable
368
368
  run the following migration(s):
369
369
 
370
370
  ```ruby
371
- change_column_default :thredded_user_preferences, :auto_follow_topics, 1
371
+ change_column_default :thredded_user_preferences, :auto_follow_topics, true
372
372
  ```
373
373
 
374
374
  ## I18n
@@ -655,7 +655,7 @@ before updating this to full Babel.
655
655
  All Thredded JavaScript is compatible with the following Turbolinks options:
656
656
 
657
657
  * No Turbolinks.
658
- * Tubrolinks 5.
658
+ * Turbolinks 5.
659
659
  * Turbolinks Classic.
660
660
  * Turbolinks Classic + jquery-turbolinks.
661
661
 
@@ -31,24 +31,33 @@ module Thredded
31
31
  attr_reader :post
32
32
 
33
33
  # Returns the users that have:
34
- # UserMessageboardPreference#auto_follow_topics? && UserPreference#auto_follow_topics?
35
- # If the `user_preference` for a given does not exist, its default value is used.
34
+ #
35
+ # COALESCE(
36
+ # `user_messageboard_preferences`.`auto_follow_topics`,
37
+ # `user_preferences`.`auto_follow_topics`,
38
+ # default for `user_preferences`.`auto_follow_topics`
39
+ # ) = true
40
+ #
36
41
  # @return [Enumerable<Thredded.user_class>]
37
42
  def auto_followers
38
- user_board_prefs = post.messageboard.user_messageboard_preferences.each_with_object({}) do |ump, h|
39
- h[ump.user_id] = ump
40
- end
41
- Thredded.user_class.includes(:thredded_user_preference)
43
+ u = Thredded.user_class.arel_table
44
+ u_pkey = u[Thredded.user_class.primary_key]
45
+ up = Thredded::UserPreference.arel_table
46
+ ump = Thredded::UserMessageboardPreference.arel_table
47
+ coalesce = [
48
+ ump[:auto_follow_topics],
49
+ up[:auto_follow_topics],
50
+ ]
51
+ coalesce << Arel::Nodes::Quoted.new(true) if Thredded::UserPreference.column_defaults['auto_follow_topics']
52
+ Thredded.user_class
42
53
  .select(Thredded.user_class.primary_key)
43
- .find_each(batch_size: 50_000).select do |user|
44
-
45
- result = user_board_prefs[user.id]
46
- result ||= Thredded::UserMessageboardPreference.new(
47
- messageboard: post.messageboard,
48
- user_preference: user.thredded_user_preference
49
- )
50
- result.auto_follow_topics?
51
- end
54
+ .joins(
55
+ u.join(up, Arel::Nodes::OuterJoin)
56
+ .on(up[:user_id].eq(u_pkey))
57
+ .join(ump, Arel::Nodes::OuterJoin)
58
+ .on(ump[:user_id].eq(u_pkey).and(ump[:messageboard_id].eq(post.messageboard_id)))
59
+ .join_sources
60
+ ).where(Arel::Nodes::NamedFunction.new('COALESCE', coalesce).eq(true))
52
61
  end
53
62
 
54
63
  # @return [Enumerable<Thredded.user_class>]
@@ -5,7 +5,7 @@ de:
5
5
  content_blocked_notice: Blockiert
6
6
  content_blocked_notice_with_record_html: Blockiert von %{moderator} %{time_ago}
7
7
  email_notifier:
8
- by_email: Per E-mail
8
+ by_email: Per E-Mail
9
9
  emails:
10
10
  message_notification:
11
11
  html:
@@ -124,7 +124,7 @@ de:
124
124
  unread_topics: Ungelesen
125
125
  null_user_name: Gelöschte Nutzer
126
126
  posts:
127
- delete: Beitrag gelöscht
127
+ delete: Beitrag löschen
128
128
  delete_confirm: Bist du sicher, dass du diesen Beitrag löschen willst?
129
129
  deleted_notice: Dein Beitrag wurde gelöscht
130
130
  edit: :thredded.nav.edit_post
@@ -172,7 +172,7 @@ de:
172
172
  private_posts:
173
173
  form:
174
174
  content_label: Nachricht
175
- create_btn: Nchricht senden
175
+ create_btn: Nachricht senden
176
176
  create_btn_submitting: Senden...
177
177
  update_btn_submitting: :thredded.form.update_btn_submitting
178
178
  private_topics:
@@ -212,7 +212,7 @@ de:
212
212
  edit: Diskussion bearbeiten
213
213
  follow: Folge dieser Diskussion
214
214
  followed_by: 'gefolgt von:'
215
- followed_by_noone: Die Diskussion wird von Niemandem verfolgt
215
+ followed_by_noone: Die Diskussion wird von niemandem verfolgt
216
216
  followed_notice: Du folgst der Diskussion
217
217
  following:
218
218
  auto: Du folgst dieser Diskussion, da automatisches Folgen aktiviert ist
@@ -245,7 +245,7 @@ de:
245
245
  started_by_html: Gestartet %{time_ago} von %{user}
246
246
  sticky:
247
247
  label: Angepinnt
248
- unfollow: Nich mehr folgen
248
+ unfollow: Nicht mehr folgen
249
249
  unfollowed_notice: Du folgst der Diskussion nicht mehr
250
250
  updated_notice: Beitrag aktualisiert
251
251
  unread_topics:
@@ -255,7 +255,7 @@ de:
255
255
  page_title: Ungelesene Themen
256
256
  page_title_in_messageboard: "%{messageboard}: Ungelesene Themen"
257
257
  users:
258
- currently_online: Zurzeit Online
258
+ currently_online: Zurzeit online
259
259
  last_active_html: Zuletzt aktiv %{time_ago}
260
260
  posted_in_topic_html: Hochgeladen in %{topic_link}
261
261
  posts_count:
@@ -47,8 +47,13 @@ module Thredded
47
47
  'span' => %w[class],
48
48
  'div' => %w[class],
49
49
  'img' => %w[src longdesc class],
50
+ 'th' => %w[style],
51
+ 'td' => %w[style],
50
52
  :all => HTML::Pipeline::SanitizationFilter::WHITELIST[:attributes][:all] +
51
53
  %w[aria-expanded aria-label aria-labelledby aria-live aria-hidden aria-pressed role],
54
+ },
55
+ css: {
56
+ properties: %w[text-align],
52
57
  }
53
58
  )
54
59
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Thredded
4
- VERSION = '0.16.10'
4
+ VERSION = '0.16.11'
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.16.10
4
+ version: 0.16.11
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: 2019-03-31 00:00:00.000000000 Z
12
+ date: 2019-04-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: active_record_union
@@ -1026,7 +1026,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1026
1026
  - !ruby/object:Gem::Version
1027
1027
  version: '0'
1028
1028
  requirements: []
1029
- rubygems_version: 3.0.2
1029
+ rubygems_version: 3.0.3
1030
1030
  signing_key:
1031
1031
  specification_version: 4
1032
1032
  summary: The best Rails forums engine ever.