trailblazer / trailblazer-operation

Trailblazer's Operation implementation.
https://trailblazer.to/2.1/docs/operation.html
87 stars 24 forks source link

SimpleDelegator isn't automatically included #21

Closed bbugh closed 4 years ago

bbugh commented 6 years ago

Much like httparty trailblazer-operation has an issue with SimpleDelegator no longer being automatically loaded by Ruby standard library. This shows up in a standalone app (which I found out by trying to do the Operation Basics in the guide. A simple fix would be for trailblazer-operation to require 'delegate' like how httparty fixed it.

> rspec ./spec/blog_post/operation/create_spec.rb

Failure/Error: require "trailblazer/operation"

NameError:
  uninitialized constant Trailblazer::Operation::Trace::SimpleDelegator
# .../trailblazer-operation-0.1.3/lib/trailblazer/operation/trace.rb:33:in `<module:Trace>'
# .../trailblazer-operation-0.1.3/lib/trailblazer/operation/trace.rb:3:in `<class:Operation>'
# .../trailblazer-operation-0.1.3/lib/trailblazer/operation/trace.rb:2:in `<module:Trailblazer>'
# .../trailblazer-operation-0.1.3/lib/trailblazer/operation/trace.rb:1:in `<top (required)>'
# .../trailblazer-operation-0.1.3/lib/trailblazer/operation.rb:24:in `require'
# .../trailblazer-operation-0.1.3/lib/trailblazer/operation.rb:24:in `<top (required)>'
# ./app/blog_post/operation/create.rb:1:in `require'
# ./app/blog_post/operation/create.rb:1:in `<top (required)>'
# ./spec/blog_post/operation/create_spec.rb:2:in `require_relative'
# ./spec/blog_post/operation/create_spec.rb:2:in `<top (required)>'
apotonick commented 6 years ago

I wonder why this bug is not breaking any of the builds? :thinking:

mensfeld commented 4 years ago

lol it broke mine today

apotonick commented 4 years ago

Maybe we could release a maintenance patch for the 2.0 line, @yogeshjain999?

mensfeld commented 4 years ago

for 2.7.0 ruby I had to require 'delegate'

apotonick commented 4 years ago

I'm guessing with an older version of operation?

mensfeld commented 4 years ago

@apotonick https://github.com/coditsu/macros/commit/21b0940d9fce6f40e893c43b77c49fffa3a3ba15 and https://github.com/coditsu/macros/blob/master/Gemfile.lock#L85

yogeshjain999 commented 4 years ago

This is fixed and released in v0.6.2