Run rubocop --fix-layout and remove encoding comments

This commit is contained in:
Patrick Gansterer 2021-03-01 15:27:26 +01:00
parent fa63e6e81d
commit ea2862fdef
283 changed files with 1164 additions and 1969 deletions

View file

@ -10,8 +10,8 @@ class Message < ApplicationRecord
attr_accessor :send_method, :recipient_tokens, :order_id
scope :threads, -> { where(:reply_to => nil) }
scope :thread, -> (id) { where("id = ? OR reply_to = ?", id, id) }
scope :readable_for, -> (user) {
scope :thread, ->(id) { where("id = ? OR reply_to = ?", id, id) }
scope :readable_for, ->(user) {
user_id = user.try(&:id)
joins(:message_recipients)
@ -128,12 +128,13 @@ class Message < ApplicationRecord
def can_toggle_private?(user)
return true if sender == user
return false if private?
user.role_admin?
end
private
def create_salt
self.salt = [Array.new(6){rand(256).chr}.join].pack("m").chomp
self.salt = [Array.new(6) { rand(256).chr }.join].pack("m").chomp
end
end

View file

@ -1,6 +1,4 @@
# encoding: utf-8
class Messagegroup < Group
validates_uniqueness_of :name
protected