mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-16 14:17:00 +08:00
21 lines
471 B
Ruby
21 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
|