Sha256: 256759f0796bee4a3ef1ab76ca04697564a6358b8cbafa564a9da72686da23b3

Contents?: true

Size: 652 Bytes

Versions: 6

Compression:

Stored size: 652 Bytes

Contents

class EveApp::SolarSystem < EveApp::ApplicationRecord
  JITA = 30000142
  PERIMITER = 30000144
  NEW_CALDARI = 30000145
  AMARR = 30002187
  NIYABAINEN = 30000143
  P3EN = 30000250
  ASHAB = 30003491
  MAURASI = 30000140

  belongs_to :region
  belongs_to :constellation

  has_many :jumps, class_name: 'SolarSystemJump', foreign_key: :from_solar_system_id
  has_many :stations

  scope :nspace, -> { where(id: 30000000..30999999) }
  scope :wspace, -> { where(id: 31000000..31999999) }

  def security_category
    case security.round(1)
    when (0.5..1.0)  then :high
    when (0.0..0.4)  then :low
    when (-1.0..0.0) then :null
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
eve_app-0.1.34 app/models/eve_app/solar_system.rb
eve_app-0.1.33 app/models/eve_app/solar_system.rb
eve_app-0.1.32 app/models/eve_app/solar_system.rb
eve_app-0.1.31 app/models/eve_app/solar_system.rb
eve_app-0.1.29 app/models/eve_app/solar_system.rb
eve_app-0.1.27 app/models/eve_app/solar_system.rb