Sha256: c23ffc91764a3c63871f2d443f21b8480e50d113c877b01c9379e03b3961812c

Contents?: true

Size: 515 Bytes

Versions: 7

Compression:

Stored size: 515 Bytes

Contents

require 'earth/model'
require 'falls_back_on'

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

  TABLE_STRUCTURE = <<-EOS

CREATE TABLE computation_carriers
  (
     name                      CHARACTER VARYING(255) NOT NULL PRIMARY KEY,
     power_usage_effectiveness FLOAT
  );

EOS

  self.primary_key = "name"
  
  falls_back_on :name => 'fallback',
                :power_usage_effectiveness => lambda { ComputationCarrier.maximum('power_usage_effectiveness') }
  
  warn_unless_size 1
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
earth-1.2.1 lib/earth/computation/computation_carrier.rb
earth-1.1.2 lib/earth/computation/computation_carrier.rb
earth-1.1.1 lib/earth/computation/computation_carrier.rb
earth-1.1.0 lib/earth/computation/computation_carrier.rb
earth-1.0.3 lib/earth/computation/computation_carrier.rb
earth-1.0.2 lib/earth/computation/computation_carrier.rb
earth-1.0.1 lib/earth/computation/computation_carrier.rb