lib/checkoff/internal/selector_classes/common.rb in checkoff-0.63.0 vs lib/checkoff/internal/selector_classes/common.rb in checkoff-0.63.1

- old
+ new

@@ -148,11 +148,11 @@ # @param resource [Asana::Resources::Task,Asana::Resources::Project] # @param custom_field_gid [String] # @param custom_field_values_gids [Array<String>] # @return [Boolean] def evaluate(resource, custom_field_gid, custom_field_values_gids) - actual_custom_field_values_gids = pull_custom_field_values_gids(resource, custom_field_gid) + actual_custom_field_values_gids = pull_custom_field_values_gids_or_raise(resource, custom_field_gid) actual_custom_field_values_gids.any? do |custom_field_value| custom_field_values_gids.include?(custom_field_value) end end @@ -170,18 +170,18 @@ false end # @param resource [Asana::Resources::Task,Asana::Resources::Project] # @param custom_field_name [String] - # @param custom_field_values [Array<String>] + # @param custom_field_value_names [Array<String>] # @return [Boolean] - def evaluate(resource, custom_field_name, custom_field_values) - custom_field = pull_custom_field_by_name(resource, custom_field_name) + def evaluate(resource, custom_field_name, custom_field_value_names) + actual_custom_field_values_names = pull_custom_field_values_names_by_name(resource, custom_field_name) - return false if custom_field.nil? - - custom_field_values.include?(custom_field.fetch('display_value')) + actual_custom_field_values_names.any? do |custom_field_value| + custom_field_value_names.include?(custom_field_value) + end end end # :custom_field_gid_value_contains_all_gids function class CustomFieldGidValueContainsAllGidsFunctionEvaluator < FunctionEvaluator @@ -198,10 +198,10 @@ # @param resource [Asana::Resources::Task,Asana::Resources::Project] # @param custom_field_gid [String] # @param custom_field_values_gids [Array<String>] # @return [Boolean] def evaluate(resource, custom_field_gid, custom_field_values_gids) - actual_custom_field_values_gids = pull_custom_field_values_gids(resource, custom_field_gid) + actual_custom_field_values_gids = pull_custom_field_values_gids_or_raise(resource, custom_field_gid) custom_field_values_gids.all? do |custom_field_value| actual_custom_field_values_gids.include?(custom_field_value) end end