lib/ecoportal/api/v2/page/component/action_field.rb in ecoportal-api-v2-0.9.3 vs lib/ecoportal/api/v2/page/component/action_field.rb in ecoportal-api-v2-0.9.4

- old
+ new

@@ -6,12 +6,16 @@ class ActionField < Page::Component passboolean :create_actions passthrough :required_number_of_completed_actions passboolean :permits_and_rules_integration, :add_subscribed, :add_subscribed_to_tasks passarray :permitted_person_schema_ids, order_matters: false - + embeds_many :actions, klass: "Ecoportal::API::V2::Page::Component::Action", order_key: :weight + def empty? + actions.empty? + end + # Adds a task with `name` short description # @return [Ecoportal::API::V2::Page::Component::Action] def add_task (name) task_doc = actions.items_class.new_doc actions.upsert!(task_doc) do |task|