mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-06-01 04:38:27 -04:00
24 lines
527 B
Ruby
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
|