Sha256: e2ce3d8aa0a534748ae61d3608df5f0d7460d576ae620bf82ad1c96d7b246c70

Contents?: true

Size: 487 Bytes

Versions: 2

Compression:

Stored size: 487 Bytes

Contents

module Enumerable
  def with_fortschritt(**opts)
    Fortschritt.init(size, **opts)
    self
  end
end

class Object
  def fortschritt
    Fortschritt.increment
    self
  end
end

if defined?(Rails)
  module Fortschritt::ActiveRecordExtension
    def with_fortschritt(**opts)
      Fortschritt.init(size, **opts)
      self
    end
  end

  ActiveRecord::Relation.include Fortschritt::ActiveRecordExtension
  ActiveRecord::Base.singleton_class.delegate :with_fortschritt, to: :all
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fortschritt-1.0.3 lib/fortschritt/enumerable.rb
fortschritt-1.0.2 lib/fortschritt/enumerable.rb