I have a Resource that has an Attribute called type
that is an enum.
I’m creating separate create Actions for each type and so want to set the type in the action itself since we know it.
attribute :type, :atom do
constraints one_of: [:paragraph, :image, :table, :citation]
allow_nil? false
end
create :create_paragraph do
argument :order, :integer, allow_nil?: false
argument :body, :string, allow_nil?: false
end
I want to set the Attribute type to :paragraph