Sha256: c7aff78fc52c96c32663fe3d847f0b948d8e6e508a232f10fd68841549ee2bf9

Contents?: true

Size: 540 Bytes

Versions: 6

Compression:

Stored size: 540 Bytes

Contents

class Industry < ActiveRecord::Base
  set_primary_key :naics_code
  
  has_many :merchant_category_industries, :foreign_key => 'naics_code'
  
  has_many :industry_product_lines, :foreign_key => 'naics_code'
  has_many :product_lines, :through => :industry_product_lines
  
  has_many :industry_sectors, :foreign_key => 'naics_code'
  has_many :sectors, :through => :industry_sectors
  
  col :naics_code
  col :description, :type => :text

  def trade_industry?
    prefix = naics_code.to_s[0,2]
    %w{42 44 45}.include?(prefix)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
earth-0.11.0 lib/earth/industry/industry.rb
earth-0.7.0 lib/earth/industry/industry.rb
earth-0.6.6 lib/earth/industry/industry.rb
earth-0.6.5 lib/earth/industry/industry.rb
earth-0.6.4 lib/earth/industry/industry.rb
earth-0.6.3 lib/earth/industry/industry.rb