Make rubocop happy.
This commit is contained in:
parent
fe0806eb2a
commit
79e8596332
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class DataExplorer::QueryController < ::ApplicationController
|
||||
requires_plugin DataExplorer.plugin_name
|
||||
|
||||
|
@ -18,7 +20,7 @@ class DataExplorer::QueryController < ::ApplicationController
|
|||
query.name = attributes["name"]
|
||||
query.description = attributes["description"]
|
||||
query.user_id = Discourse::SYSTEM_USER_ID.to_s
|
||||
queries << query
|
||||
queries << query
|
||||
end
|
||||
|
||||
render_serialized queries, DataExplorer::QuerySerializer, root: 'queries'
|
||||
|
@ -48,7 +50,7 @@ class DataExplorer::QueryController < ::ApplicationController
|
|||
queries = DataExplorer::Query
|
||||
.where(hidden: false)
|
||||
.joins("INNER JOIN data_explorer_query_groups
|
||||
ON data_explorer_query_groups.query_id = data_explorer_queries.id
|
||||
ON data_explorer_query_groups.query_id = data_explorer_queries.id
|
||||
AND data_explorer_query_groups.group_id = #{@group.id}")
|
||||
render_serialized(queries, DataExplorer::QuerySerializer, root: 'queries')
|
||||
end
|
||||
|
|
|
@ -37,4 +37,3 @@ module DataExplorer
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -8,4 +8,3 @@ module DataExplorer
|
|||
belongs_to :group
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class DataExplorer::QuerySerializer < ActiveModel::Serializer
|
||||
attributes :id, :sql, :name, :description, :param_info, :created_at, :username, :group_ids, :last_run_at, :hidden, :user_id
|
||||
|
||||
|
@ -13,4 +15,3 @@ class DataExplorer::QuerySerializer < ActiveModel::Serializer
|
|||
object.groups.map(&:id)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class DataExplorer::SmallBadgeSerializer < ApplicationSerializer
|
||||
attributes :id, :name, :badge_type, :description, :icon
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class DataExplorer::SmallPostWithExcerptSerializer < ApplicationSerializer
|
||||
attributes :id, :topic_id, :post_number, :excerpt, :username, :avatar_template
|
||||
def excerpt
|
||||
|
|
Loading…
Reference in New Issue