mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-27 03:02:43 -04:00
27 lines
593 B
Ruby
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
|