Sha256: df74d217088575cee4fc70ba98a4513eb3e552680956340007f1d41b74a6f7c7

Contents?: true

Size: 398 Bytes

Versions: 2

Compression:

Stored size: 398 Bytes

Contents

module Dune::Api
  class Investment < ::Investment
    scope :between_values, ->(start_at, ends_at) do
      return all unless start_at.present? && ends_at.present?
      where('value between ? and ?',
            start_at.to_s.sub(',', '').to_f,
            ends_at.to_s.sub(',', '').to_f)
    end

    scope :by_project_id, ->(project_id) do
      where(project_id: project_id)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dune-api-1.0.2 app/models/dune/api/investment.rb
dune-api-1.0.1 app/models/dune/api/investment.rb