mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-17 06:35:14 +08:00
22 lines
471 B
Ruby
22 lines
471 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
class ShareableTeamSerializer < ActiveModel::Serializer
|
||
|
include Rails.application.routes.url_helpers
|
||
|
|
||
|
attributes :id, :name, :private_shared_with, :private_shared_with_write
|
||
|
|
||
|
def private_shared_with
|
||
|
repository.private_shared_with?(object)
|
||
|
end
|
||
|
|
||
|
def private_shared_with_write
|
||
|
repository.private_shared_with_write?(object)
|
||
|
end
|
||
|
|
||
|
private
|
||
|
|
||
|
def repository
|
||
|
scope[:repository] || @instance_options[:repository]
|
||
|
end
|
||
|
end
|