mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-15 13:45:25 +08:00
21 lines
446 B
Ruby
21 lines
446 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
|
|
model.private_shared_with?(object)
|
|
end
|
|
|
|
def private_shared_with_write
|
|
model.private_shared_with_write?(object)
|
|
end
|
|
|
|
private
|
|
|
|
def model
|
|
scope[:model] || @instance_options[:model]
|
|
end
|
|
end
|