Sha256: a7b312dc33233878b5123327a16916b89f61214a533ba213545da976faab4691

Contents?: true

Size: 1.17 KB

Versions: 3

Compression:

Stored size: 1.17 KB

Contents

require 'earth/model'

require 'earth/residence/residence_fuel_type'

class ResidenceFuelPrice < ActiveRecord::Base
  extend Earth::Model

  TABLE_STRUCTURE = <<-EOS

CREATE TABLE residence_fuel_prices
  (
     row_hash                 CHARACTER VARYING(255) NOT NULL PRIMARY KEY,
     residence_fuel_type_name CHARACTER VARYING(255),
     year                     INTEGER,
     month                    INTEGER,
     price                    FLOAT,
     price_units              CHARACTER VARYING(255),
     price_description        CHARACTER VARYING(255),
     locatable_id             CHARACTER VARYING(255),
     locatable_type           CHARACTER VARYING(255)
  );
CREATE INDEX index_residence_fuel_prices_on_price_and_residence_fu239358947 ON residence_fuel_prices (price, residence_fuel_type_name, month, year, locatable_type, locatable_id);
CREATE INDEX index_residence_fuel_prices_on_price_and_residence_fu1975072203 ON residence_fuel_prices (price, residence_fuel_type_name)

EOS

  self.primary_key = "row_hash"
  
  belongs_to :fuel, :class_name => 'ResidenceFuelType', :foreign_key => 'residence_fuel_type_name'
  belongs_to :locatable, :polymorphic => true
  
  warn_unless_size 13741
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
earth-1.0.3 lib/earth/residence/residence_fuel_price.rb
earth-1.0.2 lib/earth/residence/residence_fuel_price.rb
earth-1.0.1 lib/earth/residence/residence_fuel_price.rb