Sha256: 58651755e5353b82a03b0dc4bcd9a199fa9c403d51e1a2b835b0d73d7bb87c2b

Contents?: true

Size: 504 Bytes

Versions: 16

Compression:

Stored size: 504 Bytes

Contents

class EveApp::ActivityMaterial < EveApp::ApplicationRecord
  include EveApp::ActivityRelation

  belongs_to :material_type, class_name: 'EveApp::Type', foreign_key: :material_type_id

  scope :buildable, -> { joins(:material_type).where.not(eve_types: { blueprint_type_id: nil }) }
  scope :simple, -> { joins(:material_type).where(eve_types: { blueprint_type_id: nil }) }
  # scope :order_by_quantity, -> { order(quantity: :desc) }

  def quantity_for(runs)
    runs > 0 ? runs * quantity : 0
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
eve_app-0.1.34 app/models/eve_app/activity_material.rb
eve_app-0.1.33 app/models/eve_app/activity_material.rb
eve_app-0.1.32 app/models/eve_app/activity_material.rb
eve_app-0.1.31 app/models/eve_app/activity_material.rb
eve_app-0.1.29 app/models/eve_app/activity_material.rb
eve_app-0.1.27 app/models/eve_app/activity_material.rb
eve_app-0.1.22 app/models/eve_app/activity_material.rb
eve_app-0.1.21 app/models/eve_app/activity_material.rb
eve_app-0.1.20 app/models/eve_app/activity_material.rb
eve_app-0.1.19 app/models/eve_app/activity_material.rb
eve_app-0.1.18 app/models/eve_app/activity_material.rb
eve_app-0.1.17 app/models/eve_app/activity_material.rb
eve_app-0.1.16 app/models/eve_app/activity_material.rb
eve_app-0.1.14 app/models/eve_app/activity_material.rb
eve_app-0.1.13 app/models/eve_app/activity_material.rb
eve_app-0.1.12 app/models/eve_app/activity_material.rb