evanthegrayt / standup_md

👨‍⚕️ Standup Doctor: An automated and customizable way to keep track of daily standups in markdown files.
MIT License
4 stars 1 forks source link

Fix Entry#create's yield #55

Closed evanthegrayt closed 3 years ago

evanthegrayt commented 3 years ago

This is wrong. Shouldn't yield config, but entry.

   def self.create
      entry = new(
        Date.today,
        config.current,
        config.previous,
        config.impediments,
        config.notes
      )
      yield config if block_given?
      entry
    end

Should be

   def self.create
      new(
        Date.today,
        config.current,
        config.previous,
        config.impediments,
        config.notes
      ).tap { |config| yield config if block_given? }
    end