Module: EPlat::Concerns::Metafieldable
Overview
< ActiveResource::CustomMethods
Instance Method Summary collapse
Instance Method Details
#add_metafield(metafield) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/e_plat/resource/concerns/metafieldable.rb', line 18 def () raise ArgumentError, "You can only add metafields to a resource that has been saved" if new? .owner_id = id .owner_resource = self.class.element_name .save end |
#find_metafield(id) ⇒ Object
14 15 16 |
# File 'lib/e_plat/resource/concerns/metafieldable.rb', line 14 def (id) .find { |m| m.id == id } end |
#metafields(**options) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/e_plat/resource/concerns/metafieldable.rb', line 7 def (**) Metafield.find(:all, from: , params: ) end |