Sha256: 6b1fbd001032c09b4b482ea1317e5eeac75386d0cca3dc34ade3e89d9fa7b135

Contents?: true

Size: 1.49 KB

Versions: 138

Compression:

Stored size: 1.49 KB

Contents

module Caboose
  class StoreConfig < ActiveRecord::Base
    self.table_name = 'store_configs'    
    
    belongs_to :site    
    attr_accessible :id,
      :site_id,            
      :pp_name,     
      :pp_username,
      :pp_password,
      :pp_testing,
      :pp_relay_url,      
      :ups_username,
      :ups_password,
      :ups_key,
      :ups_origin_account,
      :usps_username,
      :usps_secret_key,
      :usps_publishable_key,
      :fedex_username,
      :fedex_password,
      :fedex_key,
      :fedex_account,
      :ups_min,
      :ups_max,
      :usps_min,
      :usps_max,
      :fedex_min,                
      :fedex_max,
      :taxcloud_api_id,
      :taxcloud_api_key,
      :origin_country, 
      :origin_state, 
      :origin_city, 
      :origin_zip,           
      :fulfillment_email,
      :shipping_email,
      :handling_percentage,
      :auto_calculate_packages,
      :auto_calculate_shipping,
      :auto_calculate_tax,
      :custom_packages_function,   
      :custom_shipping_function,   
      :custom_tax_function,                  
      :length_unit,
      :download_instructions,
      :weight_unit
      
    WEIGHT_UNIT_METRIC   = 'g'
    WEIGHT_UNIT_IMPERIAL = 'oz'
    LENGTH_UNIT_METRIC   = 'cm'
    LENGTH_UNIT_IMPERIAL = 'in'
      
    def next_order_number
      x = Order.where("order_number is not null").reorder("order_number desc").limit(1).first
      return x.order_number + 1 if x
      return self.starting_order_number      
    end
        
  end
end

Version data entries

138 entries across 138 versions & 1 rubygems

Version Path
caboose-cms-0.6.5 app/models/caboose/store_config.rb
caboose-cms-0.6.4 app/models/caboose/store_config.rb
caboose-cms-0.6.3 app/models/caboose/store_config.rb
caboose-cms-0.6.2 app/models/caboose/store_config.rb
caboose-cms-0.6.1 app/models/caboose/store_config.rb
caboose-cms-0.5.238 app/models/caboose/store_config.rb
caboose-cms-0.5.237 app/models/caboose/store_config.rb
caboose-cms-0.5.236 app/models/caboose/store_config.rb
caboose-cms-0.5.235 app/models/caboose/store_config.rb
caboose-cms-0.5.234 app/models/caboose/store_config.rb
caboose-cms-0.5.233 app/models/caboose/store_config.rb
caboose-cms-0.5.232 app/models/caboose/store_config.rb
caboose-cms-0.5.231 app/models/caboose/store_config.rb
caboose-cms-0.5.230 app/models/caboose/store_config.rb
caboose-cms-0.5.229 app/models/caboose/store_config.rb
caboose-cms-0.5.228 app/models/caboose/store_config.rb
caboose-cms-0.5.227 app/models/caboose/store_config.rb
caboose-cms-0.5.226 app/models/caboose/store_config.rb
caboose-cms-0.5.225 app/models/caboose/store_config.rb
caboose-cms-0.5.224 app/models/caboose/store_config.rb