Skip to content

Class Kit is incompatible with the proc symbol method. #19

@victormartins

Description

@victormartins

It seems that class kit does not allow us to use the shortcut collection.max(&:some_method) so we need to use the block version.

 array_of_entities.max(&:workflow_version)
ArgumentError: wrong number of arguments (given 1, expected 0)
from /usr/lib/ruby/gems/2.4.0/gems/class_kit-0.4.0/lib/class_kit/class_methods.rb:15:in `block (2 levels) in attr_accessor_type'

array_of_entities.max { |e| e.workflow_version }
=> #<SomeModule::SomeModule::SomeModule::Workflow:0x000055d5495ba918
 @created_at=1525168505.8044086,
 @definition={"name"=>"test_event", "steps"=>[{"type"=>"action", "workflow"=>"test_event", "on_fail_step"=>"failure_event", "key"=>"step_1", "klass"=>"Foo"}, {"type"=>"action", "workflow"=>"test_event", "key"=>"failure_event", "klass"=>"Foo"}]},
 @event_type="some_event_type",
 @workflow_type="some_event_type",
 @workflow_version=2>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions