datashift 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. data/.document +5 -5
  2. data/Gemfile +28 -25
  3. data/LICENSE.txt +26 -26
  4. data/README.markdown +302 -285
  5. data/README.rdoc +19 -19
  6. data/Rakefile +93 -95
  7. data/VERSION +5 -5
  8. data/datashift.gemspec +162 -178
  9. data/lib/applications/jruby/jexcel_file.rb +396 -396
  10. data/lib/applications/jruby/word.rb +79 -79
  11. data/lib/datashift.rb +152 -113
  12. data/lib/datashift/exceptions.rb +11 -11
  13. data/lib/datashift/file_definitions.rb +353 -353
  14. data/lib/datashift/mapping_file_definitions.rb +87 -87
  15. data/lib/datashift/method_detail.rb +236 -236
  16. data/lib/datashift/method_mapper.rb +256 -256
  17. data/lib/generators/csv_generator.rb +36 -36
  18. data/lib/generators/excel_generator.rb +121 -121
  19. data/lib/generators/generator_base.rb +13 -13
  20. data/lib/helpers/core_ext/to_b.rb +24 -24
  21. data/lib/helpers/spree_helper.rb +131 -131
  22. data/lib/java/poi-3.7/LICENSE +507 -507
  23. data/lib/java/poi-3.7/NOTICE +21 -21
  24. data/lib/java/poi-3.7/RELEASE_NOTES.txt +115 -115
  25. data/lib/loaders/csv_loader.rb +98 -98
  26. data/lib/loaders/excel_loader.rb +154 -149
  27. data/lib/loaders/loader_base.rb +403 -331
  28. data/lib/loaders/spreadsheet_loader.rb +136 -136
  29. data/lib/loaders/spree/image_loader.rb +45 -45
  30. data/lib/loaders/spree/product_loader.rb +224 -224
  31. data/spec/csv_loader_spec.rb +30 -30
  32. data/spec/datashift_spec.rb +26 -26
  33. data/spec/db/migrate/20110803201325_create_test_bed.rb +85 -85
  34. data/spec/excel_generator_spec.rb +78 -78
  35. data/spec/excel_loader_spec.rb +204 -176
  36. data/spec/file_definitions.rb +141 -141
  37. data/spec/fixtures/.~lock.ProjectsSingleCategories.xls# +1 -0
  38. data/spec/fixtures/ProjectsDefaults.yml +29 -0
  39. data/spec/fixtures/config/database.yml +24 -24
  40. data/spec/fixtures/interact_models_db.sqlite +0 -0
  41. data/spec/fixtures/interact_spree_db.sqlite +0 -0
  42. data/spec/fixtures/negative/SpreeProdMiss1Mandatory.csv +4 -4
  43. data/spec/fixtures/negative/SpreeProdMissManyMandatory.csv +4 -4
  44. data/spec/fixtures/spree/SpreeProducts.csv +4 -4
  45. data/spec/fixtures/spree/SpreeProductsMultiColumn.csv +4 -4
  46. data/spec/fixtures/spree/SpreeProductsSimple.csv +4 -4
  47. data/spec/fixtures/spree/SpreeZoneExample.csv +5 -5
  48. data/spec/fixtures/test_model_defs.rb +57 -57
  49. data/spec/loader_spec.rb +120 -120
  50. data/spec/method_mapper_spec.rb +237 -237
  51. data/spec/spec_helper.rb +115 -115
  52. data/spec/spree_generator_spec.rb +64 -64
  53. data/spec/spree_loader_spec.rb +310 -310
  54. data/spec/spree_method_mapping_spec.rb +214 -214
  55. data/tasks/config/seed_fu_product_template.erb +15 -15
  56. data/tasks/config/tidy_config.txt +12 -12
  57. data/tasks/db_tasks.rake +65 -64
  58. data/tasks/excel_generator.rake +78 -78
  59. data/tasks/file_tasks.rake +36 -36
  60. data/tasks/import/csv.rake +49 -49
  61. data/tasks/import/excel.rake +71 -66
  62. data/tasks/spree/image_load.rake +108 -108
  63. data/tasks/spree/product_loader.rake +43 -43
  64. data/tasks/word_to_seedfu.rake +166 -166
  65. data/test/helper.rb +18 -18
  66. data/test/test_interact.rb +7 -7
  67. metadata +7 -38
  68. data/Gemfile.lock +0 -211
  69. data/bin/autospec +0 -16
  70. data/bin/convert_to_should_syntax +0 -16
  71. data/bin/erubis +0 -16
  72. data/bin/htmldiff +0 -16
  73. data/bin/jeweler +0 -16
  74. data/bin/ldiff +0 -16
  75. data/bin/nokogiri +0 -16
  76. data/bin/rackup +0 -16
  77. data/bin/rails +0 -16
  78. data/bin/rake +0 -16
  79. data/bin/rake2thor +0 -16
  80. data/bin/ri +0 -16
  81. data/bin/rspec +0 -16
  82. data/bin/spree +0 -16
  83. data/bin/thor +0 -16
  84. data/bin/tilt +0 -16
  85. data/bin/tt +0 -16
@@ -1,141 +1,141 @@
1
- # To change this template, choose Tools | Templates
2
- # and open the template in the editor.
3
-
4
- $:.unshift File.join(File.dirname(__FILE__),'..','lib')
5
- $:.unshift File.join(File.dirname(__FILE__),'..','lib', 'engine')
6
-
7
- require 'test/unit'
8
- require 'file_definitions'
9
-
10
- class File_definitions < Test::Unit::TestCase
11
-
12
- def setup
13
- end
14
-
15
- def test_fields_string
16
- klass = Object.const_set('B', Class.new)
17
-
18
- klass.module_eval do
19
- include FileDefinitions
20
- create_field_definition 'a_string'
21
-
22
- create_field_attr_accessors
23
- end
24
-
25
- x = B.new '33'
26
- assert_equal '33', x.a_string
27
-
28
- end
29
-
30
-
31
- def test_fields_symbols
32
- klass = Object.const_set('SymClass', Class.new)
33
- klass.module_eval do
34
- include FileDefinitions
35
- create_field_definition [:a_symbol, :b_symbol]
36
-
37
- create_field_attr_accessors
38
- end
39
-
40
- assert SymClass.new.respond_to? :a_symbol
41
- assert SymClass.new.respond_to? :b_symbol
42
- end
43
-
44
- def test_fields_strings
45
- klass = Object.const_set('A', Class.new)
46
- klass.module_eval do
47
- include FileDefinitions
48
- create_field_definition %w{abc def ghi jkl}
49
-
50
- create_field_attr_accessors
51
- end
52
-
53
- x = A.new
54
-
55
- assert_equal ["abc", "def", "ghi", "jkl"], A.field_definition.sort
56
-
57
- A::add_field( "xyz" )
58
-
59
- line = '1,2,3,4, 5'
60
- x = A.new(line)
61
-
62
- assert x.respond_to? 'abc'
63
- assert x.respond_to? 'abc='
64
- assert x.respond_to? :jkl
65
- assert_equal x.current_line, line
66
- assert_equal '1', x.abc
67
- assert_equal 1.0, x.abc.to_f
68
- assert_equal 1, x.abc.to_i
69
- assert_equal '4', x.jkl
70
- assert_equal ' 5', x.xyz
71
-
72
- end
73
-
74
- def test_fixed_strings
75
-
76
- klass = Object.const_set('AFixed', Class.new)
77
-
78
- klass.module_eval do
79
- include FileDefinitions
80
-
81
- create_fixed_definition( 'value' => (0..7), 'date' => (8..15), :ccy => (16..18) )
82
-
83
- create_field_attr_accessors
84
- end
85
-
86
- assert AFixed.respond_to?('fixed_definition')
87
- assert AFixed.respond_to?('field_definition')
88
- assert AFixed.respond_to?('add_field')
89
- assert AFixed.respond_to?('file_set_field_by_map')
90
- assert AFixed.respond_to?('split_on')
91
- assert AFixed.respond_to?('split_on_write')
92
-
93
- x = AFixed.new('0123456719990113EUR')
94
-
95
- assert x.respond_to?('value')
96
- assert x.respond_to?(:date)
97
- assert x.respond_to?('ccy')
98
-
99
- assert AFixed.field_definition.include?('ccy')
100
-
101
- assert_equal 3, AFixed.field_definition.size
102
- assert_equal 3, AFixed.fixed_definition.keys.size
103
-
104
- assert_equal ["ccy", "date", "value"], AFixed.field_definition.sort
105
-
106
- assert_equal AFixed.field_definition.sort, AFixed.fixed_definition.keys.sort
107
-
108
- assert_instance_of Range, AFixed.fixed_definition.values[0]
109
-
110
- assert_equal x.current_line, '0123456719990113EUR'
111
- assert_equal x.value, '01234567'
112
- assert_equal x.date, '19990113'
113
- assert_equal x.ccy, 'EUR'
114
-
115
- assert x.respond_to?(:parse)
116
-
117
- x.parse('9876543220100630USD')
118
-
119
- assert_equal x.current_line, '9876543220100630USD'
120
- assert_equal x.value, '98765432'
121
- assert_equal x.date, '20100630'
122
- assert_equal x.ccy, 'USD'
123
-
124
- end
125
-
126
- def test_bad_setup
127
- klass = Object.const_set('ABadClass', Class.new)
128
- begin
129
- klass.module_eval do
130
- include FileDefinitions
131
-
132
- create_fixed_definition( 'abc' )
133
-
134
- create_field_attr_accessors
135
- end
136
- flunk # We should never get here
137
- rescue => e
138
- assert e
139
- end
140
- end
141
- end
1
+ # To change this template, choose Tools | Templates
2
+ # and open the template in the editor.
3
+
4
+ $:.unshift File.join(File.dirname(__FILE__),'..','lib')
5
+ $:.unshift File.join(File.dirname(__FILE__),'..','lib', 'engine')
6
+
7
+ require 'test/unit'
8
+ require 'file_definitions'
9
+
10
+ class File_definitions < Test::Unit::TestCase
11
+
12
+ def setup
13
+ end
14
+
15
+ def test_fields_string
16
+ klass = Object.const_set('B', Class.new)
17
+
18
+ klass.module_eval do
19
+ include FileDefinitions
20
+ create_field_definition 'a_string'
21
+
22
+ create_field_attr_accessors
23
+ end
24
+
25
+ x = B.new '33'
26
+ assert_equal '33', x.a_string
27
+
28
+ end
29
+
30
+
31
+ def test_fields_symbols
32
+ klass = Object.const_set('SymClass', Class.new)
33
+ klass.module_eval do
34
+ include FileDefinitions
35
+ create_field_definition [:a_symbol, :b_symbol]
36
+
37
+ create_field_attr_accessors
38
+ end
39
+
40
+ assert SymClass.new.respond_to? :a_symbol
41
+ assert SymClass.new.respond_to? :b_symbol
42
+ end
43
+
44
+ def test_fields_strings
45
+ klass = Object.const_set('A', Class.new)
46
+ klass.module_eval do
47
+ include FileDefinitions
48
+ create_field_definition %w{abc def ghi jkl}
49
+
50
+ create_field_attr_accessors
51
+ end
52
+
53
+ x = A.new
54
+
55
+ assert_equal ["abc", "def", "ghi", "jkl"], A.field_definition.sort
56
+
57
+ A::add_field( "xyz" )
58
+
59
+ line = '1,2,3,4, 5'
60
+ x = A.new(line)
61
+
62
+ assert x.respond_to? 'abc'
63
+ assert x.respond_to? 'abc='
64
+ assert x.respond_to? :jkl
65
+ assert_equal x.current_line, line
66
+ assert_equal '1', x.abc
67
+ assert_equal 1.0, x.abc.to_f
68
+ assert_equal 1, x.abc.to_i
69
+ assert_equal '4', x.jkl
70
+ assert_equal ' 5', x.xyz
71
+
72
+ end
73
+
74
+ def test_fixed_strings
75
+
76
+ klass = Object.const_set('AFixed', Class.new)
77
+
78
+ klass.module_eval do
79
+ include FileDefinitions
80
+
81
+ create_fixed_definition( 'value' => (0..7), 'date' => (8..15), :ccy => (16..18) )
82
+
83
+ create_field_attr_accessors
84
+ end
85
+
86
+ assert AFixed.respond_to?('fixed_definition')
87
+ assert AFixed.respond_to?('field_definition')
88
+ assert AFixed.respond_to?('add_field')
89
+ assert AFixed.respond_to?('file_set_field_by_map')
90
+ assert AFixed.respond_to?('split_on')
91
+ assert AFixed.respond_to?('split_on_write')
92
+
93
+ x = AFixed.new('0123456719990113EUR')
94
+
95
+ assert x.respond_to?('value')
96
+ assert x.respond_to?(:date)
97
+ assert x.respond_to?('ccy')
98
+
99
+ assert AFixed.field_definition.include?('ccy')
100
+
101
+ assert_equal 3, AFixed.field_definition.size
102
+ assert_equal 3, AFixed.fixed_definition.keys.size
103
+
104
+ assert_equal ["ccy", "date", "value"], AFixed.field_definition.sort
105
+
106
+ assert_equal AFixed.field_definition.sort, AFixed.fixed_definition.keys.sort
107
+
108
+ assert_instance_of Range, AFixed.fixed_definition.values[0]
109
+
110
+ assert_equal x.current_line, '0123456719990113EUR'
111
+ assert_equal x.value, '01234567'
112
+ assert_equal x.date, '19990113'
113
+ assert_equal x.ccy, 'EUR'
114
+
115
+ assert x.respond_to?(:parse)
116
+
117
+ x.parse('9876543220100630USD')
118
+
119
+ assert_equal x.current_line, '9876543220100630USD'
120
+ assert_equal x.value, '98765432'
121
+ assert_equal x.date, '20100630'
122
+ assert_equal x.ccy, 'USD'
123
+
124
+ end
125
+
126
+ def test_bad_setup
127
+ klass = Object.const_set('ABadClass', Class.new)
128
+ begin
129
+ klass.module_eval do
130
+ include FileDefinitions
131
+
132
+ create_fixed_definition( 'abc' )
133
+
134
+ create_field_attr_accessors
135
+ end
136
+ flunk # We should never get here
137
+ rescue => e
138
+ assert e
139
+ end
140
+ end
141
+ end
@@ -0,0 +1 @@
1
+ ,autotelik,unknown-10-9a-dd-57-47-ff.home,12.02.2012 13:54,file:///Users/autotelik/Library/Application%20Support/OpenOffice.org/3;
@@ -0,0 +1,29 @@
1
+ ## YAML Template.
2
+
3
+ # Format is :
4
+ # --- !ruby/object:ActiveRecordModel
5
+ # :datashift_defaults
6
+ # :key value
7
+ #
8
+
9
+ Project:
10
+ datashift_defaults:
11
+ value_as_string: "Default Project Value"
12
+ category: reference:category_002
13
+
14
+ datashift_overrides:
15
+ value_as_double: 99.23546
16
+
17
+ --- !ruby/object:Project
18
+ attributes:
19
+ id:
20
+ title:
21
+ value_as_string: ""
22
+ value_as_text: "object has value text"
23
+ value_as_boolean:
24
+ value_as_datetime:
25
+ value_as_integer: 23
26
+ value_as_double: 45.82
27
+ created_at:
28
+ updated_at:
29
+
@@ -1,25 +1,25 @@
1
- <% adapter = 'sqlite3' %>
2
- <% adapter = 'jdbcsqlite3' if(Guards::jruby? ) %>
3
-
4
- test_mysql:
5
- adapter: jdbcmysql
6
- database: interact_test_db
7
- username: test
8
- password: test
9
- host: localhost
10
-
11
- test_memory:
12
- adapter: <%= adapter %>
13
- database: :memory
14
-
15
- test_file:
16
- adapter: <%= adapter %>
17
- database: <%= File.join($DataShiftFixturePath, 'interact_models_db.sqlite') %>
18
- encoding: utf8
19
- host: localhost
20
-
21
- test_spree_standalone:
22
- adapter: <%= adapter %>
23
- database: <%= File.join($DataShiftFixturePath, 'interact_spree_db.sqlite') %>
24
- encoding: utf8
1
+ <% adapter = 'sqlite3' %>
2
+ <% adapter = 'jdbcsqlite3' if(Guards::jruby? ) %>
3
+
4
+ test_mysql:
5
+ adapter: jdbcmysql
6
+ database: interact_test_db
7
+ username: test
8
+ password: test
9
+ host: localhost
10
+
11
+ test_memory:
12
+ adapter: <%= adapter %>
13
+ database: :memory
14
+
15
+ test_file:
16
+ adapter: <%= adapter %>
17
+ database: <%= File.join($DataShiftFixturePath, 'interact_models_db.sqlite') %>
18
+ encoding: utf8
19
+ host: localhost
20
+
21
+ test_spree_standalone:
22
+ adapter: <%= adapter %>
23
+ database: <%= File.join($DataShiftFixturePath, 'interact_spree_db.sqlite') %>
24
+ encoding: utf8
25
25
  host: localhost
Binary file
@@ -1,4 +1,4 @@
1
- "Name","Description","Available On"," Price","CostPrice","product_properties","count_on_hand","Taxons","Option Types"
2
- "Demo Product for AR Loader","blah blah","2011-02-14",400.00,320.00,"name:test_pp_001",12,"Paintings","mime_type:jpeg, PDF,PNG"
3
- "Demo Excel Load via Jruby","less blah","2011-05-14",100.00,30.00,"name:test_pp_001",5,"Paintings","mime_type:jpeg, PDF,PNG"
4
- "Demo third row in future","more blah blah","2012-07-01",50.34,23.34,"name:test_pp_002,test_pp_003",23,"Drawings","mime_type:jpeg,PDF,PNG|print_type:black_white,colour"
1
+ "Name","Description","Available On"," Price","CostPrice","product_properties","count_on_hand","Taxons","Option Types"
2
+ "Demo Product for AR Loader","blah blah","2011-02-14",400.00,320.00,"name:test_pp_001",12,"Paintings","mime_type:jpeg, PDF,PNG"
3
+ "Demo Excel Load via Jruby","less blah","2011-05-14",100.00,30.00,"name:test_pp_001",5,"Paintings","mime_type:jpeg, PDF,PNG"
4
+ "Demo third row in future","more blah blah","2012-07-01",50.34,23.34,"name:test_pp_002,test_pp_003",23,"Drawings","mime_type:jpeg,PDF,PNG|print_type:black_white,colour"
@@ -1,4 +1,4 @@
1
- "SKU","Description","Available On","CostPrice","product_properties","count_on_hand","Taxons","Option Types"
2
- "DEMO_001","blah blah","2011-02-14",320.00,"name:test_pp_001",12,"Paintings","mime_type:jpeg, PDF,PNG"
3
- "DEMO_002","less blah","2011-05-14",30.00,"name:test_pp_001",5,"Paintings","mime_type:jpeg, PDF,PNG"
4
- "DEMO_003","more blah blah","2012-07-01",23.34,"name:test_pp_002,test_pp_003",23,"Drawings","mime_type:jpeg,PDF,PNG|print_type:black_white,colour"
1
+ "SKU","Description","Available On","CostPrice","product_properties","count_on_hand","Taxons","Option Types"
2
+ "DEMO_001","blah blah","2011-02-14",320.00,"name:test_pp_001",12,"Paintings","mime_type:jpeg, PDF,PNG"
3
+ "DEMO_002","less blah","2011-05-14",30.00,"name:test_pp_001",5,"Paintings","mime_type:jpeg, PDF,PNG"
4
+ "DEMO_003","more blah blah","2012-07-01",23.34,"name:test_pp_002,test_pp_003",23,"Drawings","mime_type:jpeg,PDF,PNG|print_type:black_white,colour"
@@ -1,4 +1,4 @@
1
- "SKU","Name","Description","Available On"," Price","CostPrice","product_properties","Taxons","Variants","count_on_hand"
2
- "DEMO_001","Demo Product for AR Loader","blah blah","2011-02-14",399.99,320.00,"test_pp_001","Paintings|WaterColour","mime_type:jpeg,PDF,PNG","12|6|7"
3
- "DEMO_002","Demo Excel Load via Jruby","less blah","2011-05-14",100.00,30.00,"test_pp_003","Paintings|Landscape|Oils","mime_type:jpeg, PDF,PNG","5|4|2"
4
- "DEMO_003","Demo third row in future","more blah blah","2012-07-01",50.34,23.34,"test_pp_002|test_pp_003:Example free value|yet_another_property","Drawings","mime_type:jpeg,PDF,PNG|print_type:black_white,colour","12|4|7|12|18"
1
+ "SKU","Name","Description","Available On"," Price","CostPrice","product_properties","Taxons","Variants","count_on_hand"
2
+ "DEMO_001","Demo Product for AR Loader","blah blah","2011-02-14",399.99,320.00,"test_pp_001","Paintings|WaterColour","mime_type:jpeg,PDF,PNG","12|6|7"
3
+ "DEMO_002","Demo Excel Load via Jruby","less blah","2011-05-14",100.00,30.00,"test_pp_003","Paintings|Landscape|Oils","mime_type:jpeg, PDF,PNG","5|4|2"
4
+ "DEMO_003","Demo third row in future","more blah blah","2012-07-01",50.34,23.34,"test_pp_002|test_pp_003:Example free value|yet_another_property","Drawings","mime_type:jpeg,PDF,PNG|print_type:black_white,colour","12|4|7|12|18"
@@ -1,4 +1,4 @@
1
- "SKU","Name","Description","Available On"," Price","CostPrice","product_properties","product_properties","product_properties","Taxons","Taxons","Taxons","Option Types","Option Types","Variants","Variants","Variants","count_on_hand"
2
- "DEMO_001","Demo Product for AR Loader","blah blah","2011-02-14",399.99,320.00,"test_pp_001",,,"Paintings","WaterColour",,"mime_type:jpeg","mime_type:PDF","mime_type:PNG",,,"12|6|7"
3
- "DEMO_002","Demo Excel Load via Jruby","less blah","2011-05-14",100.00,30.00,"test_pp_003",,,"Paintings","Landscape","Oils","mime_type:jpeg","mime_type:PDF","mime_type:PNG",,,"5|4|2"
4
- "DEMO_003","Demo third row in future","more blah blah","2012-07-01",50.34,23.34,"test_pp_002","test_pp_003:Example free value","yet_another_property","Drawings",,,"mime_type:jpeg","mime_type:PDF","mime_type:PNG","print_type:black_white","print_type:colour","12|4|7|12|18"
1
+ "SKU","Name","Description","Available On"," Price","CostPrice","product_properties","product_properties","product_properties","Taxons","Taxons","Taxons","Option Types","Option Types","Variants","Variants","Variants","count_on_hand"
2
+ "DEMO_001","Demo Product for AR Loader","blah blah","2011-02-14",399.99,320.00,"test_pp_001",,,"Paintings","WaterColour",,"mime_type:jpeg","mime_type:PDF","mime_type:PNG",,,"12|6|7"
3
+ "DEMO_002","Demo Excel Load via Jruby","less blah","2011-05-14",100.00,30.00,"test_pp_003",,,"Paintings","Landscape","Oils","mime_type:jpeg","mime_type:PDF","mime_type:PNG",,,"5|4|2"
4
+ "DEMO_003","Demo third row in future","more blah blah","2012-07-01",50.34,23.34,"test_pp_002","test_pp_003:Example free value","yet_another_property","Drawings",,,"mime_type:jpeg","mime_type:PDF","mime_type:PNG","print_type:black_white","print_type:colour","12|4|7|12|18"
@@ -1,4 +1,4 @@
1
- "SKU","Name","Description","Available On"," Price","CostPrice","count_on_hand","Option Types"
2
- "SIMPLE_001","Simple Product for AR Loader","blah blah","2011-02-14",345.78,320.00,12,"mime_type"
3
- "SIMPLE_002","Simple Excel Load via Jruby","less blah","2011-05-14",100.00,30.00,5,"mime_type"
4
- "SIMPLE_003","Simple third row avail in future","more blah blah","2012-07-01",50.34,23.34,23,"mime_type|print_type"
1
+ "SKU","Name","Description","Available On"," Price","CostPrice","count_on_hand","Option Types"
2
+ "SIMPLE_001","Simple Product for AR Loader","blah blah","2011-02-14",345.78,320.00,12,"mime_type"
3
+ "SIMPLE_002","Simple Excel Load via Jruby","less blah","2011-05-14",100.00,30.00,5,"mime_type"
4
+ "SIMPLE_003","Simple third row avail in future","more blah blah","2012-07-01",50.34,23.34,23,"mime_type|print_type"
@@ -1,5 +1,5 @@
1
- "Name","Description"
2
- "ROW","Rest of World"
3
- "UK","United Kingdom"
4
- "EUR","Europe"
5
- "NA","North America"
1
+ "Name","Description"
2
+ "ROW","Rest of World"
3
+ "UK","United Kingdom"
4
+ "EUR","Europe"
5
+ "NA","North America"
@@ -1,57 +1,57 @@
1
-
2
- class Project < ActiveRecord::Base
3
-
4
- has_one :owner
5
-
6
- has_many :milestones
7
-
8
- has_many :loader_releases
9
- has_many :versions, :through => :loader_releases
10
-
11
-
12
- #has_many :release_versions, :through => :loader_releases, :source => :versions
13
-
14
- has_and_belongs_to_many :categories
15
-
16
- end
17
-
18
- class Owner < ActiveRecord::Base
19
- belongs_to :project
20
- end
21
-
22
- class Milestone < ActiveRecord::Base
23
- belongs_to :project
24
- #validate the name, cost
25
-
26
- delegate :title, :title=, :to => :project
27
- end
28
-
29
- # had_and_belongs to join table
30
- class Category < ActiveRecord::Base
31
- has_and_belongs_to_many :projects
32
- end
33
-
34
-
35
- class Version < ActiveRecord::Base
36
- has_many :releases
37
-
38
- has_one :long_and_complex_table_linked_to_version
39
- end
40
-
41
- # Join Table with additional columns
42
- class LoaderRelease < ActiveRecord::Base
43
-
44
- belongs_to :project
45
- belongs_to :version
46
-
47
- #validate the name
48
- end
49
-
50
- class Empty < ActiveRecord::Base
51
- end
52
-
53
- # Join Table with additional columns
54
- class LongAndComplexTableLinkedToVersion < ActiveRecord::Base
55
-
56
- belongs_to :version
57
- end
1
+
2
+ class Project < ActiveRecord::Base
3
+
4
+ has_one :owner
5
+
6
+ has_many :milestones
7
+
8
+ has_many :loader_releases
9
+ has_many :versions, :through => :loader_releases
10
+
11
+
12
+ #has_many :release_versions, :through => :loader_releases, :source => :versions
13
+
14
+ has_and_belongs_to_many :categories
15
+
16
+ end
17
+
18
+ class Owner < ActiveRecord::Base
19
+ belongs_to :project
20
+ end
21
+
22
+ class Milestone < ActiveRecord::Base
23
+ belongs_to :project
24
+ #validate the name, cost
25
+
26
+ delegate :title, :title=, :to => :project
27
+ end
28
+
29
+ # had_and_belongs to join table
30
+ class Category < ActiveRecord::Base
31
+ has_and_belongs_to_many :projects
32
+ end
33
+
34
+
35
+ class Version < ActiveRecord::Base
36
+ has_many :releases
37
+
38
+ has_one :long_and_complex_table_linked_to_version
39
+ end
40
+
41
+ # Join Table with additional columns
42
+ class LoaderRelease < ActiveRecord::Base
43
+
44
+ belongs_to :project
45
+ belongs_to :version
46
+
47
+ #validate the name
48
+ end
49
+
50
+ class Empty < ActiveRecord::Base
51
+ end
52
+
53
+ # Join Table with additional columns
54
+ class LongAndComplexTableLinkedToVersion < ActiveRecord::Base
55
+
56
+ belongs_to :version
57
+ end