earth 0.1.4 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,10 +1,10 @@
1
- require 'earth/industry/industries_product_lines'
2
- require 'earth/industry/industries_sectors'
1
+ require 'earth/industry/industry_product_line'
2
+ require 'earth/industry/industry_sector'
3
3
  require 'earth/industry/industry'
4
4
  require 'earth/industry/merchant'
5
- require 'earth/industry/merchant_categories_industries'
5
+ require 'earth/industry/merchant_category_industry'
6
6
  require 'earth/industry/merchant_category'
7
7
  require 'earth/industry/product_line'
8
- require 'earth/industry/product_lines_sectors'
8
+ require 'earth/industry/product_line_sector'
9
9
  require 'earth/industry/sector'
10
10
 
@@ -2,12 +2,11 @@ class Industry < ActiveRecord::Base
2
2
  extend Earth::Base
3
3
  set_primary_key :naics_code
4
4
 
5
- has_many :industries_product_lines, :foreign_key => 'naics_code'
5
+ has_many :industry_product_lines, :foreign_key => 'naics_code'
6
6
  has_many :product_lines, :through => :industries_product_lines
7
- has_many :industries_sectors, :foreign_key => 'naics_code'
8
- has_many :sectors, :through => :industries_sectors
9
- has_many :merchant_categories_industries, :foreign_key => 'naics_code',
10
- :class_name => 'MerchantCategoriesIndustries'
7
+ has_many :industry_sectors, :foreign_key => 'naics_code'
8
+ has_many :sectors, :through => :industry_sectors
9
+ has_many :merchant_category_industries, :foreign_key => 'naics_code'
11
10
 
12
11
  def self.schema_definition
13
12
  lambda do
@@ -1,4 +1,4 @@
1
- class IndustriesProductLines < ActiveRecord::Base
1
+ class IndustryProductLine < ActiveRecord::Base
2
2
  extend Earth::Base
3
3
  set_primary_key :row_hash
4
4
 
@@ -16,6 +16,6 @@ class IndustriesProductLines < ActiveRecord::Base
16
16
  end
17
17
 
18
18
  data_miner do
19
- IndustriesProductLines.define_schema(self)
19
+ IndustryProductLine.define_schema(self)
20
20
  end
21
21
  end
@@ -1,4 +1,4 @@
1
- class IndustriesSectors < ActiveRecord::Base
1
+ class IndustrySector < ActiveRecord::Base
2
2
  extend Earth::Base
3
3
  belongs_to :industry, :foreign_key => 'naics_code'
4
4
  belongs_to :sector, :foreign_key => 'io_code'
@@ -12,6 +12,6 @@ class IndustriesSectors < ActiveRecord::Base
12
12
  end
13
13
 
14
14
  data_miner do
15
- IndustriesSectors.define_schema(self)
15
+ IndustrySector.define_schema(self)
16
16
  end
17
17
  end
@@ -2,8 +2,8 @@ class MerchantCategory < ActiveRecord::Base
2
2
  extend Earth::Base
3
3
  set_primary_key :mcc
4
4
 
5
- has_many :merchant_categories_industries, :foreign_key => 'mcc', :class_name => 'MerchantCategoriesIndustries'
6
- has_many :industries, :through => :merchant_categories_industries
5
+ has_many :merchant_category_industries, :foreign_key => 'mcc'
6
+ has_many :industries, :through => :merchant_category_industries
7
7
 
8
8
  def name
9
9
  description
@@ -0,0 +1,20 @@
1
+ class MerchantCategoryIndustry < ActiveRecord::Base
2
+ extend Earth::Base
3
+
4
+ belongs_to :merchant_category, :foreign_key => 'mcc'
5
+ belongs_to :industry, :foreign_key => 'naics_code'
6
+ has_many :industry_product_lines, :through => :industry
7
+ has_many :industry_sectors, :through => :industry
8
+
9
+ def self.schema_definition
10
+ lambda do
11
+ string 'mcc'
12
+ float 'ratio'
13
+ string 'naics_code'
14
+ end
15
+ end
16
+
17
+ data_miner do
18
+ MerchantCategoryIndustry.define_schema(self)
19
+ end
20
+ end
@@ -2,8 +2,8 @@ class ProductLine < ActiveRecord::Base
2
2
  extend Earth::Base
3
3
  set_primary_key :ps_code
4
4
 
5
- has_many :product_lines_sectors, :foreign_key => 'ps_code'
6
- has_many :sectors, :through => :product_lines_sectors
5
+ has_many :product_line_sectors, :foreign_key => 'ps_code'
6
+ has_many :sectors, :through => :product_line_sectors
7
7
 
8
8
  def self.schema_definition
9
9
  lambda do
@@ -1,4 +1,4 @@
1
- class ProductLinesSectors < ActiveRecord::Base
1
+ class ProductLineSector < ActiveRecord::Base
2
2
  extend Earth::Base
3
3
  belongs_to :product_line, :foreign_key => 'ps_code'
4
4
  belongs_to :sector, :foreign_key => 'io_code'
@@ -13,6 +13,6 @@ class ProductLinesSectors < ActiveRecord::Base
13
13
  end
14
14
 
15
15
  data_miner do
16
- ProductLinesSectors.define_schema(self)
16
+ ProductLineSector.define_schema(self)
17
17
  end
18
18
  end
@@ -2,7 +2,7 @@ class Sector < ActiveRecord::Base
2
2
  extend Earth::Base
3
3
  set_primary_key :io_code
4
4
 
5
- has_many :product_lines_sectors, :class_name => 'ProductLinesSectors', :foreign_key => 'io_code'
5
+ has_many :product_line_sectors, :foreign_key => 'io_code'
6
6
 
7
7
  def self.schema_definition
8
8
  lambda do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: earth
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 1
9
- - 4
10
- version: 0.1.4
8
+ - 2
9
+ - 0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Seamus Abshere
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2010-09-21 00:00:00 -05:00
20
+ date: 2010-09-21 00:00:00 -04:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
@@ -28,7 +28,7 @@ dependencies:
28
28
  requirements:
29
29
  - - ">="
30
30
  - !ruby/object:Gem::Version
31
- hash: 299253624
31
+ hash: -1848230024
32
32
  segments:
33
33
  - 3
34
34
  - 0
@@ -324,14 +324,14 @@ files:
324
324
  - lib/earth/hospitality/lodging_class.rb
325
325
  - lib/earth/hospitality/lodging_class/data_miner.rb
326
326
  - lib/earth/industry.rb
327
- - lib/earth/industry/industries_product_lines.rb
328
- - lib/earth/industry/industries_sectors.rb
329
327
  - lib/earth/industry/industry.rb
328
+ - lib/earth/industry/industry_product_line.rb
329
+ - lib/earth/industry/industry_sector.rb
330
330
  - lib/earth/industry/merchant.rb
331
- - lib/earth/industry/merchant_categories_industries.rb
332
331
  - lib/earth/industry/merchant_category.rb
332
+ - lib/earth/industry/merchant_category_industry.rb
333
333
  - lib/earth/industry/product_line.rb
334
- - lib/earth/industry/product_lines_sectors.rb
334
+ - lib/earth/industry/product_line_sector.rb
335
335
  - lib/earth/industry/sector.rb
336
336
  - lib/earth/inflectors.rb
337
337
  - lib/earth/locality.rb
@@ -1,20 +0,0 @@
1
- class MerchantCategoriesIndustries < ActiveRecord::Base
2
- extend Earth::Base
3
-
4
- belongs_to :merchant_category, :foreign_key => 'mcc'
5
- belongs_to :industry, :foreign_key => 'naics_code'
6
- has_many :industries_product_lines, :through => :industry, :class_name => 'IndustriesProductLines'
7
- has_many :industries_sectors, :through => :industry, :class_name => 'IndustriesSectors'
8
-
9
- def self.schema_definition
10
- lambda do
11
- string 'mcc'
12
- float 'ratio'
13
- string 'naics_code'
14
- end
15
- end
16
-
17
- data_miner do
18
- MerchantCategoriesIndustries.define_schema(self)
19
- end
20
- end