Files
growstuff/app/resources/api/v1/photo_resource.rb
2025-09-29 00:11:41 +09:30

24 lines
527 B
Ruby

# frozen_string_literal: true
module Api
module V1
class PhotoResource < BaseResource
immutable # TODO: Re-evaluate this.
before_create do
@model.owner = context[:current_user]
end
has_one :owner, class_name: 'Member', always_include_linkage_data: true
has_many :plantings
has_many :gardens
has_many :harvests
attribute :thumbnail_url
attribute :fullsize_url
attribute :license_name
attribute :link_url
attribute :title
end
end
end