scinote-web/app/serializers/shareable_team_serializer.rb
2024-01-05 19:03:14 +01:00

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