Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
victormartins opened this issue May 1, 2018 · 0 comments
Open

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

victormartins opened this issue May 1, 2018 · 0 comments

Comments

@victormartins
Copy link

victormartins commented May 1, 2018

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant