fast_jsonapi
fast_jsonapi copied to clipboard
How can I reference dynamic attributes inside of other dynamic attributes?
The following fails with undefined method 'person_path'
attribute :person_path do |obj|
url_helpers.person_path obj
end
attribute :edit_person_path do |obj|
"#{obj.person_path}/edit/person"
end
Extracting it to a class method might help: https://github.com/Netflix/fast_jsonapi/issues/344#issuecomment-438640296