Class: SpeedeeRate

Inherits:
ApplicationRecord show all
Defined in:
app/models/speedee_rate.rb

Overview

== Schema Information

Table name: speedee_rates
Database name: primary

id :integer not null, primary key
rate_for_zone_2 :float
rate_for_zone_3 :float
rate_for_zone_4 :float
rate_for_zone_5 :float
rate_for_zone_6 :float
weight :integer not null

Indexes

index_speedee_rates_on_weight (weight)

Class Method Summary collapse

Methods inherited from ApplicationRecord

ransackable_associations, ransackable_attributes, ransackable_scopes, ransortable_attributes, #to_relation

Methods included from Models::EventPublishable

#publish_event

Class Method Details

.get_rate_from_weight_and_zone(weight, zone) ⇒ Object



19
20
21
# File 'app/models/speedee_rate.rb', line 19

def self.get_rate_from_weight_and_zone(weight, zone)
  SpeedeeRate.where(weight: weight.to_i).first.send("rate_for_zone_#{zone}")
end