simple_discussion 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +44 -0
  3. data/Appraisals +16 -0
  4. data/CHANGELOG.md +10 -0
  5. data/Gemfile +8 -1
  6. data/README.md +5 -3
  7. data/Rakefile +25 -3
  8. data/app/controllers/simple_discussion/application_controller.rb +1 -1
  9. data/app/controllers/simple_discussion/forum_categories_controller.rb +5 -5
  10. data/app/controllers/simple_discussion/forum_posts_controller.rb +12 -12
  11. data/app/controllers/simple_discussion/forum_threads_controller.rb +9 -9
  12. data/app/controllers/simple_discussion/notifications_controller.rb +3 -3
  13. data/app/helpers/simple_discussion/forum_posts_helper.rb +7 -1
  14. data/app/helpers/simple_discussion/forum_threads_helper.rb +4 -4
  15. data/app/jobs/simple_discussion/forum_post_notification_job.rb +3 -3
  16. data/app/jobs/simple_discussion/forum_thread_notification_job.rb +2 -2
  17. data/app/mailers/simple_discussion/user_mailer.rb +4 -4
  18. data/app/models/forum_category.rb +1 -1
  19. data/app/models/forum_post.rb +1 -2
  20. data/app/models/forum_subscription.rb +4 -4
  21. data/app/models/forum_thread.rb +12 -12
  22. data/app/views/simple_discussion/forum_posts/_forum_post.html.erb +1 -1
  23. data/bin/rails +14 -0
  24. data/config/locales/en.yml +1 -0
  25. data/db/migrate/20170417012930_create_forum_categories.rb +5 -5
  26. data/db/migrate/20170417012932_create_forum_posts.rb +2 -2
  27. data/db/migrate/20170417012933_create_forum_subscriptions.rb +1 -1
  28. data/gemfiles/.bundle/config +2 -0
  29. data/gemfiles/rails_5_2.gemfile +12 -0
  30. data/gemfiles/rails_5_2.gemfile.lock +191 -0
  31. data/gemfiles/rails_6.gemfile +12 -0
  32. data/gemfiles/rails_6.gemfile.lock +207 -0
  33. data/gemfiles/rails_6_1.gemfile +12 -0
  34. data/gemfiles/rails_6_1.gemfile.lock +210 -0
  35. data/gemfiles/rails_master.gemfile +12 -0
  36. data/gemfiles/rails_master.gemfile.lock +222 -0
  37. data/lib/generators/simple_discussion/controllers_generator.rb +2 -2
  38. data/lib/generators/simple_discussion/helpers_generator.rb +2 -2
  39. data/lib/generators/simple_discussion/views_generator.rb +2 -2
  40. data/lib/simple_discussion.rb +8 -9
  41. data/lib/simple_discussion/engine.rb +1 -1
  42. data/lib/simple_discussion/slack.rb +6 -6
  43. data/lib/simple_discussion/version.rb +1 -1
  44. data/lib/simple_discussion/will_paginate.rb +12 -12
  45. data/simple_discussion.gemspec +15 -17
  46. metadata +17 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 20ef7fd5da8bb052ef36f73fbbd24661032fe5e14453e611a208a6f0f405e80a
4
- data.tar.gz: 1e4c484430c87b3122358dce54c744c7c5611710d3175b27c24dad9c58f39257
3
+ metadata.gz: a6d8a256590a5124e9207664dbe478583fb9cf184f14f84703e147cbe5772d8f
4
+ data.tar.gz: 0d75642a89aeadb6157d20c2a7825b1c780d76edc165fc03010afc7eaaf1632f
5
5
  SHA512:
6
- metadata.gz: 29755f4463b66a8420840b4639c520441b9c9820e2759e351d4d4e8056f2c0f867cf635f771b5f13f5393bd2ce86bb340307cb9367635eec0ab60d67a86e80ee
7
- data.tar.gz: d7a0af8b494062a347310281a22a7f41b79ba10a060a82130586160f584a007c1166ff294b6881da3b05c5f9ee4ab2f9ae5d14110e6461e6b10d4b2bfa93d786
6
+ metadata.gz: a731f814d38e2b48455a0239745e2d896a7369c19fbeb595de4d60a003eac9238ecfbbe1674ce4c655bd85f7aaea68d88d0f9de542282af50469a378c58575bc
7
+ data.tar.gz: 150c26dc9b91a30c2e497bc01d72637ab8b75f3f7d4c6fe5ba644e21c86d001a5e1b4f232ea1484e76c82edd7aa95649b6476ce7b86cf46a38626dace2a2bc80
@@ -0,0 +1,44 @@
1
+ name: Tests
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - '*'
7
+ push:
8
+ branches:
9
+ - master
10
+ jobs:
11
+ sqlite:
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ matrix:
15
+ ruby: ['2.7', '3.0']
16
+ gemfile:
17
+ - rails_5_2
18
+ - rails_6
19
+ - rails_6_1
20
+ - rails_master
21
+ exclude:
22
+ - ruby: '3.0'
23
+ gemfile: 'rails_5_2'
24
+ env:
25
+ BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
26
+ BUNDLE_PATH_RELATIVE_TO_CWD: true
27
+
28
+ steps:
29
+ - uses: actions/checkout@master
30
+ - name: Set up Ruby
31
+ uses: ruby/setup-ruby@v1
32
+ with:
33
+ ruby-version: ${{ matrix.ruby }}
34
+ bundler: default
35
+ bundler-cache: true
36
+ - name: StandardRb check
37
+ run: bundle exec standardrb
38
+ - name: Run tests
39
+ env:
40
+ DATABASE_URL: "sqlite3:noticed_test"
41
+ STRIPE_PRIVATE_KEY: ${{ secrets.STRIPE_PRIVATE_KEY }}
42
+ run: |
43
+ bin/rails db:test:prepare
44
+ bin/rails test
data/Appraisals ADDED
@@ -0,0 +1,16 @@
1
+ appraise "rails-5-2" do
2
+ gem "rails", "~> 5.2.0"
3
+ end
4
+
5
+ appraise "rails-6" do
6
+ gem "rails", "~> 6.0.0"
7
+ end
8
+
9
+ appraise "rails-6-1" do
10
+ gem "rails", "~> 6.1.0"
11
+ end
12
+
13
+ appraise "rails-master" do
14
+ gem "rails", github: "rails/rails", branch: "main"
15
+ gem "devise", github: "ghiculescu/devise", branch: "patch-2"
16
+ end
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ### Unreleased
2
+
3
+ ### 1.3.0
4
+
5
+ * Drop gravatar dependency
6
+ * Test against Rails 5.2, 6.0, 6.1, and Rails master
7
+ * Fix nested layout rendering
8
+ * Add dummy app for testing
9
+ * Relax Font Awesome dependency
10
+
1
11
  ### 1.2.0
2
12
 
3
13
  * Update to require Font Awesome 5.x+
data/Gemfile CHANGED
@@ -1,6 +1,13 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
3
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
4
4
 
5
5
  # Specify your gem's dependencies in simple_discussion.gemspec
6
6
  gemspec
7
+
8
+ gem "appraisal"
9
+ gem "standardrb"
10
+
11
+ gem "devise"
12
+ gem "puma"
13
+ gem "sqlite3"
data/README.md CHANGED
@@ -1,8 +1,10 @@
1
- # SimpleDiscussion
1
+ # SimpleDiscussion - Forum engine for Ruby on Rails
2
2
 
3
- SimpleDiscussion is a Rails forum gem extracting the [forum from GoRails](https://gorails.com/forum). It includes categories, simple moderation, the ability to mark threads as solved, and more.
3
+ [![Build Status](https://github.com/excid3/simple_discussion/workflows/Tests/badge.svg)](https://github.com/excid3/simple_discussion/actions) [![Gem Version](https://badge.fury.io/rb/simple_discussion.svg)](https://badge.fury.io/rb/simple_discussion)
4
4
 
5
- Out of the box, SimpleDiscussion comes with styling for Boostrap v4 but you're free to customize the UI as much as you like by installing the views and tweaking the HTML.
5
+ SimpleDiscussion is a Rails forum gem extracting the [GoRails forum](https://gorails.com/forum). It includes categories, simple moderation, the ability to mark threads as solved, and more.
6
+
7
+ Out of the box, SimpleDiscussion comes with styling for Bootstrap v4 but you're free to customize the UI as much as you like by installing the views and tweaking the HTML.
6
8
 
7
9
  [![GoRails Forum](https://d3vv6lp55qjaqc.cloudfront.net/items/3j2p3o1j0d1O0R1w2j1Y/Screen%20Shot%202017-08-08%20at%203.12.01%20PM.png?X-CloudApp-Visitor-Id=51470&v=d439dcae)](https://d3vv6lp55qjaqc.cloudfront.net/items/3j2p3o1j0d1O0R1w2j1Y/Screen%20Shot%202017-08-08%20at%203.12.01%20PM.png?X-CloudApp-Visitor-Id=51470&v=d439dcae)
8
10
 
data/Rakefile CHANGED
@@ -1,10 +1,32 @@
1
+ begin
2
+ require "bundler/setup"
3
+ rescue LoadError
4
+ puts "You must `gem install bundler` and `bundle install` to run rake tasks"
5
+ end
6
+
1
7
  require "bundler/gem_tasks"
8
+
9
+ require "rdoc/task"
10
+
11
+ RDoc::Task.new(:rdoc) do |rdoc|
12
+ rdoc.rdoc_dir = "rdoc"
13
+ rdoc.title = "SimpleDiscussion"
14
+ rdoc.options << "--line-numbers"
15
+ rdoc.rdoc_files.include("README.md")
16
+ rdoc.rdoc_files.include("lib/**/*.rb")
17
+ end
18
+
19
+ APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
20
+ load "rails/tasks/engine.rake"
21
+
22
+ load "rails/tasks/statistics.rake"
23
+
2
24
  require "rake/testtask"
3
25
 
4
26
  Rake::TestTask.new(:test) do |t|
5
27
  t.libs << "test"
6
- t.libs << "lib"
7
- t.test_files = FileList["test/**/*_test.rb"]
28
+ t.pattern = "test/**/*_test.rb"
29
+ t.verbose = false
8
30
  end
9
31
 
10
- task :default => :test
32
+ task default: :test
@@ -2,7 +2,7 @@ class SimpleDiscussion::ApplicationController < ::ApplicationController
2
2
  layout "simple_discussion"
3
3
 
4
4
  def page_number
5
- page = params.fetch(:page, '').gsub(/[^0-9]/, '').to_i
5
+ page = params.fetch(:page, "").gsub(/[^0-9]/, "").to_i
6
6
  page = "1" if page.zero?
7
7
  page
8
8
  end
@@ -9,9 +9,9 @@ class SimpleDiscussion::ForumCategoriesController < SimpleDiscussion::Applicatio
9
9
 
10
10
  private
11
11
 
12
- def set_category
13
- @category = ForumCategory.friendly.find(params[:id])
14
- rescue ActiveRecord::RecordNotFound
15
- redirect_to simple_discussion.forum_threads_path
16
- end
12
+ def set_category
13
+ @category = ForumCategory.friendly.find(params[:id])
14
+ rescue ActiveRecord::RecordNotFound
15
+ redirect_to simple_discussion.forum_threads_path
16
+ end
17
17
  end
@@ -54,19 +54,19 @@ class SimpleDiscussion::ForumPostsController < SimpleDiscussion::ApplicationCont
54
54
 
55
55
  private
56
56
 
57
- def set_forum_thread
58
- @forum_thread = ForumThread.friendly.find(params[:forum_thread_id])
59
- end
57
+ def set_forum_thread
58
+ @forum_thread = ForumThread.friendly.find(params[:forum_thread_id])
59
+ end
60
60
 
61
- def set_forum_post
62
- if is_moderator?
63
- @forum_post = @forum_thread.forum_posts.find(params[:id])
64
- else
65
- @forum_post = current_user.forum_posts.find(params[:id])
66
- end
61
+ def set_forum_post
62
+ @forum_post = if is_moderator?
63
+ @forum_thread.forum_posts.find(params[:id])
64
+ else
65
+ current_user.forum_posts.find(params[:id])
67
66
  end
67
+ end
68
68
 
69
- def forum_post_params
70
- params.require(:forum_post).permit(:body)
71
- end
69
+ def forum_post_params
70
+ params.require(:forum_post).permit(:body)
71
+ end
72
72
  end
@@ -23,7 +23,7 @@ class SimpleDiscussion::ForumThreadsController < SimpleDiscussion::ApplicationCo
23
23
  end
24
24
 
25
25
  def participating
26
- @forum_threads = ForumThread.includes(:user, :forum_category).joins(:forum_posts).where(forum_posts: { user_id: current_user.id }).distinct(forum_posts: :id).sorted.paginate(page: page_number)
26
+ @forum_threads = ForumThread.includes(:user, :forum_category).joins(:forum_posts).where(forum_posts: {user_id: current_user.id}).distinct(forum_posts: :id).sorted.paginate(page: page_number)
27
27
  render action: :index
28
28
  end
29
29
 
@@ -39,7 +39,7 @@ class SimpleDiscussion::ForumThreadsController < SimpleDiscussion::ApplicationCo
39
39
 
40
40
  def create
41
41
  @forum_thread = current_user.forum_threads.new(forum_thread_params)
42
- @forum_thread.forum_posts.each{ |post| post.user_id = current_user.id }
42
+ @forum_thread.forum_posts.each { |post| post.user_id = current_user.id }
43
43
 
44
44
  if @forum_thread.save
45
45
  SimpleDiscussion::ForumThreadNotificationJob.perform_later(@forum_thread)
@@ -54,7 +54,7 @@ class SimpleDiscussion::ForumThreadsController < SimpleDiscussion::ApplicationCo
54
54
 
55
55
  def update
56
56
  if @forum_thread.update(forum_thread_params)
57
- redirect_to simple_discussion.forum_thread_path(@forum_thread), notice: I18n.t('your_changes_were_saved')
57
+ redirect_to simple_discussion.forum_thread_path(@forum_thread), notice: I18n.t("your_changes_were_saved")
58
58
  else
59
59
  render action: :edit
60
60
  end
@@ -62,11 +62,11 @@ class SimpleDiscussion::ForumThreadsController < SimpleDiscussion::ApplicationCo
62
62
 
63
63
  private
64
64
 
65
- def set_forum_thread
66
- @forum_thread = ForumThread.friendly.find(params[:id])
67
- end
65
+ def set_forum_thread
66
+ @forum_thread = ForumThread.friendly.find(params[:id])
67
+ end
68
68
 
69
- def forum_thread_params
70
- params.require(:forum_thread).permit(:title, :forum_category_id, forum_posts_attributes: [:body])
71
- end
69
+ def forum_thread_params
70
+ params.require(:forum_thread).permit(:title, :forum_category_id, forum_posts_attributes: [:body])
71
+ end
72
72
  end
@@ -13,7 +13,7 @@ class SimpleDiscussion::NotificationsController < SimpleDiscussion::ApplicationC
13
13
 
14
14
  private
15
15
 
16
- def set_forum_thread
17
- @forum_thread = ForumThread.friendly.find(params[:forum_thread_id])
18
- end
16
+ def set_forum_thread
17
+ @forum_thread = ForumThread.friendly.find(params[:forum_thread_id])
18
+ end
19
19
  end
@@ -1,7 +1,7 @@
1
1
  module SimpleDiscussion::ForumPostsHelper
2
2
  # Override this to use avatars from other places than Gravatar
3
3
  def avatar_tag(email)
4
- gravatar_image_tag(email, gravatar: { size: 40 }, class: "rounded avatar")
4
+ image_tag gravatar_url_for(email, size: 40), class: "rounded avatar"
5
5
  end
6
6
 
7
7
  def category_link(category)
@@ -26,4 +26,10 @@ module SimpleDiscussion::ForumPostsHelper
26
26
  content_tag :span, "Mod", class: "badge badge-default"
27
27
  end
28
28
  end
29
+
30
+ def gravatar_url_for(email, **options)
31
+ hash = Digest::MD5.hexdigest(email&.downcase || "")
32
+ options.reverse_merge!(default: :mp, rating: :pg, size: 48)
33
+ "https://secure.gravatar.com/avatar/#{hash}.png?#{options.to_param}"
34
+ end
29
35
  end
@@ -1,13 +1,13 @@
1
1
  module SimpleDiscussion::ForumThreadsHelper
2
2
  # Used for flagging links in the navbar as active
3
- def forum_link_to(path, opts={}, &block)
3
+ def forum_link_to(path, opts = {}, &block)
4
4
  link_to path, class: forum_link_class(path, opts), &block
5
5
  end
6
6
 
7
- def forum_link_class(matches, opts={})
7
+ def forum_link_class(matches, opts = {})
8
8
  case matches
9
9
  when Array
10
- "active" if matches.any?{ |m| request.path.starts_with?(m) }
10
+ "active" if matches.any? { |m| request.path.starts_with?(m) }
11
11
  when String
12
12
  "active" if opts.fetch(:exact, false) ? request.path == matches : request.path.starts_with?(matches)
13
13
  end
@@ -22,7 +22,7 @@ module SimpleDiscussion::ForumThreadsHelper
22
22
  #
23
23
  def parent_layout(layout)
24
24
  @view_flow.set(:layout, output_buffer)
25
- output = render(file: "layouts/#{layout}")
25
+ output = render(template: "layouts/#{layout}")
26
26
  self.output_buffer = ActionView::OutputBuffer.new(output)
27
27
  end
28
28
  end
@@ -8,7 +8,7 @@ class SimpleDiscussion::ForumPostNotificationJob < ApplicationJob
8
8
 
9
9
  def send_emails(forum_post)
10
10
  forum_thread = forum_post.forum_thread
11
- users = forum_thread.subscribed_users - [forum_post.user]
11
+ users = forum_thread.subscribed_users - [forum_post.user]
12
12
  users.each do |user|
13
13
  SimpleDiscussion::UserMailer.new_post(forum_post, user).deliver_later
14
14
  end
@@ -31,8 +31,8 @@ class SimpleDiscussion::ForumPostNotificationJob < ApplicationJob
31
31
  {
32
32
  title: "Posted By",
33
33
  value: forum_post.user.name,
34
- short: true,
35
- },
34
+ short: true
35
+ }
36
36
  ],
37
37
  ts: forum_post.created_at.to_i
38
38
  }
@@ -29,8 +29,8 @@ class SimpleDiscussion::ForumThreadNotificationJob < ApplicationJob
29
29
  {
30
30
  title: "Posted By",
31
31
  value: forum_post.user.name,
32
- short: true,
33
- },
32
+ short: true
33
+ }
34
34
  ],
35
35
  ts: forum_post.created_at.to_i
36
36
  }
@@ -6,8 +6,8 @@ class SimpleDiscussion::UserMailer < ApplicationMailer
6
6
 
7
7
  def new_thread(forum_thread, recipient)
8
8
  @forum_thread = forum_thread
9
- @forum_post = forum_thread.forum_posts.first
10
- @recipient = recipient
9
+ @forum_post = forum_thread.forum_posts.first
10
+ @recipient = recipient
11
11
 
12
12
  mail(
13
13
  to: "#{@recipient.name} <#{@recipient.email}>",
@@ -16,9 +16,9 @@ class SimpleDiscussion::UserMailer < ApplicationMailer
16
16
  end
17
17
 
18
18
  def new_post(forum_post, recipient)
19
- @forum_post = forum_post
19
+ @forum_post = forum_post
20
20
  @forum_thread = forum_post.forum_thread
21
- @recipient = recipient
21
+ @recipient = recipient
22
22
 
23
23
  mail(
24
24
  to: "#{@recipient.name} <#{@recipient.email}>",
@@ -2,7 +2,7 @@ class ForumCategory < ApplicationRecord
2
2
  extend FriendlyId
3
3
  friendly_id :name, use: :slugged
4
4
 
5
- scope :sorted, ->{ order(name: :asc) }
5
+ scope :sorted, -> { order(name: :asc) }
6
6
 
7
7
  validates :name, :slug, :color, presence: true
8
8
 
@@ -1,11 +1,10 @@
1
1
  class ForumPost < ApplicationRecord
2
2
  belongs_to :forum_thread, counter_cache: true, touch: true
3
3
  belongs_to :user
4
- has_many :reactions, as: :reactable
5
4
 
6
5
  validates :user_id, :body, presence: true
7
6
 
8
- scope :sorted, ->{ order(:created_at) }
7
+ scope :sorted, -> { order(:created_at) }
9
8
 
10
9
  after_update :solve_forum_thread, if: :solved?
11
10
 
@@ -2,11 +2,11 @@ class ForumSubscription < ApplicationRecord
2
2
  belongs_to :forum_thread
3
3
  belongs_to :user
4
4
 
5
- scope :optin, ->{ where(subscription_type: :optin) }
6
- scope :optout, ->{ where(subscription_type: :optout) }
5
+ scope :optin, -> { where(subscription_type: :optin) }
6
+ scope :optout, -> { where(subscription_type: :optout) }
7
7
 
8
- validates :subscription_type, presence: true, inclusion: { in: %w{ optin optout } }
9
- validates :user_id, uniqueness: { scope: :forum_thread_id }
8
+ validates :subscription_type, presence: true, inclusion: {in: %w[optin optout]}
9
+ validates :user_id, uniqueness: {scope: :forum_thread_id}
10
10
 
11
11
  def toggle!
12
12
  case subscription_type
@@ -6,8 +6,8 @@ class ForumThread < ApplicationRecord
6
6
  belongs_to :user
7
7
  has_many :forum_posts
8
8
  has_many :forum_subscriptions
9
- has_many :optin_subscribers, ->{ where(forum_subscriptions: { subscription_type: :optin }) }, through: :forum_subscriptions, source: :user
10
- has_many :optout_subscribers, ->{ where(forum_subscriptions: { subscription_type: :optout }) }, through: :forum_subscriptions, source: :user
9
+ has_many :optin_subscribers, -> { where(forum_subscriptions: {subscription_type: :optin}) }, through: :forum_subscriptions, source: :user
10
+ has_many :optout_subscribers, -> { where(forum_subscriptions: {subscription_type: :optout}) }, through: :forum_subscriptions, source: :user
11
11
  has_many :users, through: :forum_posts
12
12
 
13
13
  accepts_nested_attributes_for :forum_posts
@@ -16,11 +16,11 @@ class ForumThread < ApplicationRecord
16
16
  validates :user_id, :title, presence: true
17
17
  validates_associated :forum_posts
18
18
 
19
- scope :pinned_first, ->{ order(pinned: :desc) }
20
- scope :solved, ->{ where(solved: true) }
21
- scope :sorted, ->{ order(updated_at: :desc) }
22
- scope :unpinned, ->{ where.not(pinned: true) }
23
- scope :unsolved, ->{ where.not(solved: true) }
19
+ scope :pinned_first, -> { order(pinned: :desc) }
20
+ scope :solved, -> { where(solved: true) }
21
+ scope :sorted, -> { order(updated_at: :desc) }
22
+ scope :unpinned, -> { where.not(pinned: true) }
23
+ scope :unsolved, -> { where.not(solved: true) }
24
24
 
25
25
  def subscribed_users
26
26
  (users + optin_subscribers).uniq - optout_subscribers
@@ -56,20 +56,20 @@ class ForumThread < ApplicationRecord
56
56
  end
57
57
 
58
58
  def subscribed_reason(user)
59
- return I18n.t('.not_receiving_notifications') if user.nil?
59
+ return I18n.t(".not_receiving_notifications") if user.nil?
60
60
 
61
61
  subscription = subscription_for(user)
62
62
 
63
63
  if subscription.present?
64
64
  if subscription.subscription_type == "optout"
65
- I18n.t('.ignoring_thread')
65
+ I18n.t(".ignoring_thread")
66
66
  elsif subscription.subscription_type == "optin"
67
- I18n.t('.receiving_notifications_because_subscribed')
67
+ I18n.t(".receiving_notifications_because_subscribed")
68
68
  end
69
69
  elsif forum_posts.where(user_id: user.id).any?
70
- I18n.t('.receiving_notifications_because_posted')
70
+ I18n.t(".receiving_notifications_because_posted")
71
71
  else
72
- I18n.t('.not_receiving_notifications')
72
+ I18n.t(".not_receiving_notifications")
73
73
  end
74
74
  end
75
75