Skip to content
Snippets Groups Projects
Commit 7b692e04 authored by ArtOfCode-'s avatar ArtOfCode-
Browse files

Rubocop

parent 5ef8782a
No related merge requests found
......@@ -32,7 +32,7 @@ class ApplicationRecord < ActiveRecord::Base
end
def self.sanitize_sql_in(ary)
return "(NULL)" unless ary.present? && ary.respond_to?(:map)
return '(NULL)' unless ary.present? && ary.respond_to?(:map)
ary = ary.map { |el| ActiveRecord::Base.sanitize_sql_array(['?', el]) }
"(#{ary.join(', ')})"
......
class Tag < ApplicationRecord
include CommunityRelated
scope :category_order, -> (required_ids, topic_ids) do
helpers = ActionController::Base.helpers
scope :category_order, lambda { |required_ids, topic_ids|
order(Arel.sql("id IN #{sanitize_sql_in(required_ids)} DESC"),
Arel.sql("id IN #{sanitize_sql_in(topic_ids)} DESC"),
name: :asc)
end
}
has_and_belongs_to_many :posts
belongs_to :tag_set
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment