mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-10-31 03:09:06 -04:00
Declare read-only resources and the owner relationship once each, make the resource hook helpers private, simplify token auth, and cache the generated API docs for an hour.
16 lines
314 B
Ruby
16 lines
314 B
Ruby
# frozen_string_literal: true
|
|
|
|
class GardenResource < ApplicationResource
|
|
self.model = Garden
|
|
|
|
attribute :name, :string
|
|
filter_only :slug, :string
|
|
filter_only :active, :boolean
|
|
filter_only :location, :string
|
|
filter_only :garden_type_id, :integer
|
|
|
|
owned
|
|
has_many :plantings
|
|
photos_of 'Garden'
|
|
end
|