Sha256: 70498ae6ea2a7ccc1ab3856f90968b199f6aac93aba983b18a1ecb98dbfcfc4d
Contents?: true
Size: 684 Bytes
Versions: 9
Compression:
Stored size: 684 Bytes
Contents
require 'earth/locality' # TODO replace this with NAICS 2002? class Industry < ActiveRecord::Base self.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 class << self def format_naics_code(input) "%d" % input.to_i end end def trade_industry? prefix = naics_code.to_s[0,2] %w{42 44 45}.include?(prefix) end end
Version data entries
9 entries across 9 versions & 1 rubygems