Files
growstuff/app/resources/api/v1/crop_resource.rb
2025-09-29 00:12:39 +09:30

27 lines
593 B
Ruby

# frozen_string_literal: true
module Api
module V1
class CropResource < BaseResource
immutable # TODO: Re-evaluate this later
filter :approval_status, default: 'approved'
has_many :plantings
has_many :seeds
has_many :harvests
has_many :photos
has_one :parent, class_name: 'Crop', always_include_linkage_data: true
attribute :name
attribute :en_wikipedia_url
attribute :perennial
attribute :median_lifespan
attribute :median_days_to_first_harvest
attribute :median_days_to_last_harvest
end
end
end