Instead of using `PluginStoreRow` we should use plugin-specific models like `DataExplorer::Query` and `DataExplorer::QueryGroup`
17 lines
352 B
Ruby
17 lines
352 B
Ruby
class DataExplorer::QuerySerializer < ActiveModel::Serializer
|
|
attributes :id, :sql, :name, :description, :param_info, :created_at, :username, :group_ids, :last_run_at, :hidden, :user_id
|
|
|
|
def param_info
|
|
object&.params&.map(&:to_hash)
|
|
end
|
|
|
|
def username
|
|
object&.user&.username
|
|
end
|
|
|
|
def group_ids
|
|
object.groups.map(&:id)
|
|
end
|
|
end
|
|
|