Files
ubicloud/serializers/project.rb
Burak Yucesoy 77846c5eaf Put project's feature flags into the serialization output
These flags would be useful in frontend while making decisions, so I'm adding
them to the serialization output.
2024-10-10 21:49:50 +02:00

20 lines
362 B
Ruby

# frozen_string_literal: true
class Serializers::Project < Serializers::Base
def self.serialize_internal(p, options = {})
base = {
id: p.ubid,
name: p.name,
credit: p.credit.to_f,
discount: p.discount,
feature_flags: p.feature_flags
}
if options[:include_path]
base[:path] = p.path
end
base
end
end