has_many_polymorphs 2.10 → 2.11

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 (156) hide show
  1. data.tar.gz.sig +0 -0
  2. data/CHANGELOG +2 -0
  3. data/Manifest +191 -56
  4. data/TODO +1 -0
  5. data/examples/hmph.rb +69 -0
  6. data/generators/commenting/commenting_generator.rb +94 -0
  7. data/generators/commenting/templates/comment.rb +33 -0
  8. data/generators/commenting/templates/comment_test.rb +12 -0
  9. data/generators/commenting/templates/commenting.rb +13 -0
  10. data/generators/commenting/templates/commenting_extensions.rb +30 -0
  11. data/generators/commenting/templates/commenting_test.rb +30 -0
  12. data/generators/commenting/templates/commentings.yml +23 -0
  13. data/generators/commenting/templates/comments.yml +13 -0
  14. data/generators/commenting/templates/migration.rb +28 -0
  15. data/generators/tagging/templates/tagging_extensions.rb +4 -8
  16. data/has_many_polymorphs.gemspec +19 -12
  17. data/lib/has_many_polymorphs.rb +3 -4
  18. data/lib/has_many_polymorphs/autoload.rb +4 -4
  19. data/lib/has_many_polymorphs/class_methods.rb +8 -8
  20. data/lib/has_many_polymorphs/debugging_tools.rb +2 -0
  21. data/lib/has_many_polymorphs/dependencies.rb +9 -4
  22. data/lib/has_many_polymorphs/support_methods.rb +3 -1
  23. data/test/fixtures/{aquatic/fish.yml → fish.yml} +0 -0
  24. data/test/fixtures/{aquatic/little_whale_pupils.yml → little_whale_pupils.yml} +0 -0
  25. data/test/fixtures/{aquatic/whales.yml → whales.yml} +0 -0
  26. data/test/integration/app/README +182 -0
  27. data/test/integration/app/Rakefile +19 -0
  28. data/test/integration/app/app/controllers/addresses_controller.rb +85 -0
  29. data/test/integration/app/app/controllers/application.rb +7 -0
  30. data/test/integration/app/app/controllers/sellers_controller.rb +85 -0
  31. data/test/integration/app/app/controllers/states_controller.rb +85 -0
  32. data/test/integration/app/app/controllers/users_controller.rb +85 -0
  33. data/test/integration/app/app/helpers/addresses_helper.rb +2 -0
  34. data/test/integration/app/app/helpers/application_helper.rb +3 -0
  35. data/test/integration/app/app/helpers/sellers_helper.rb +28 -0
  36. data/test/integration/app/app/helpers/states_helper.rb +2 -0
  37. data/test/integration/app/app/helpers/users_helper.rb +2 -0
  38. data/test/integration/app/app/models/address.rb +4 -0
  39. data/test/integration/app/app/models/citation.rb +3 -0
  40. data/test/integration/app/app/models/citations_item.rb +4 -0
  41. data/test/integration/app/app/models/seller.rb +4 -0
  42. data/test/integration/app/app/models/state.rb +3 -0
  43. data/test/integration/app/app/models/user.rb +4 -0
  44. data/test/integration/app/app/views/addresses/edit.html.erb +12 -0
  45. data/test/integration/app/app/views/addresses/index.html.erb +18 -0
  46. data/test/integration/app/app/views/addresses/new.html.erb +11 -0
  47. data/test/integration/app/app/views/addresses/show.html.erb +3 -0
  48. data/test/integration/app/app/views/layouts/addresses.html.erb +17 -0
  49. data/test/integration/app/app/views/layouts/sellers.html.erb +17 -0
  50. data/test/integration/app/app/views/layouts/states.html.erb +17 -0
  51. data/test/integration/app/app/views/layouts/users.html.erb +17 -0
  52. data/test/integration/app/app/views/sellers/edit.html.erb +12 -0
  53. data/test/integration/app/app/views/sellers/index.html.erb +20 -0
  54. data/test/integration/app/app/views/sellers/new.html.erb +11 -0
  55. data/test/integration/app/app/views/sellers/show.html.erb +3 -0
  56. data/test/integration/app/app/views/states/edit.html.erb +12 -0
  57. data/test/integration/app/app/views/states/index.html.erb +19 -0
  58. data/test/integration/app/app/views/states/new.html.erb +11 -0
  59. data/test/integration/app/app/views/states/show.html.erb +3 -0
  60. data/test/integration/app/app/views/users/edit.html.erb +12 -0
  61. data/test/integration/app/app/views/users/index.html.erb +22 -0
  62. data/test/integration/app/app/views/users/new.html.erb +11 -0
  63. data/test/integration/app/app/views/users/show.html.erb +3 -0
  64. data/test/integration/app/config/boot.rb +45 -0
  65. data/test/integration/app/config/database.yml +21 -0
  66. data/test/integration/app/config/environment.rb +13 -0
  67. data/test/integration/app/config/environments/development.rb +7 -0
  68. data/test/integration/app/config/environments/production.rb +18 -0
  69. data/test/integration/app/config/environments/test.rb +19 -0
  70. data/test/integration/app/config/locomotive.yml +6 -0
  71. data/test/integration/app/config/routes.rb +33 -0
  72. data/test/integration/app/config/ultrasphinx/default.base +56 -0
  73. data/test/integration/app/config/ultrasphinx/development.conf.canonical +155 -0
  74. data/test/integration/app/db/migrate/001_create_users.rb +16 -0
  75. data/test/integration/app/db/migrate/002_create_sellers.rb +14 -0
  76. data/test/integration/app/db/migrate/003_create_addresses.rb +19 -0
  77. data/test/integration/app/db/migrate/004_create_states.rb +12 -0
  78. data/test/integration/app/db/migrate/005_add_capitalization_to_seller.rb +9 -0
  79. data/test/integration/app/db/migrate/006_add_deleted_to_user.rb +9 -0
  80. data/test/integration/app/db/migrate/007_add_lat_and_long_to_address.rb +11 -0
  81. data/test/integration/app/db/migrate/008_create_citations.rb +12 -0
  82. data/test/integration/app/db/migrate/009_create_citations_items.rb +14 -0
  83. data/test/integration/app/db/schema.rb +144 -0
  84. data/test/integration/app/doc/README_FOR_APP +2 -0
  85. data/test/integration/app/generated_models/aquatic_fish.rb +109 -0
  86. data/test/integration/app/generated_models/aquatic_pupils_whale.rb +13 -0
  87. data/test/integration/app/generated_models/aquatic_whale.rb +42 -0
  88. data/test/integration/app/generated_models/beautiful_fight_relationship.rb +25 -0
  89. data/test/integration/app/generated_models/citation.rb +40 -0
  90. data/test/integration/app/generated_models/citations_item.rb +12 -0
  91. data/test/integration/app/generated_models/dog.rb +183 -0
  92. data/test/integration/app/generated_models/eaters_foodstuff.rb +13 -0
  93. data/test/integration/app/generated_models/frog.rb +78 -0
  94. data/test/integration/app/generated_models/kitten.rb +161 -0
  95. data/test/integration/app/generated_models/parentship.rb +14 -0
  96. data/test/integration/app/generated_models/person.rb +53 -0
  97. data/test/integration/app/generated_models/petfood.rb +125 -0
  98. data/test/integration/app/generated_models/polymorph_test_some_model.rb +25 -0
  99. data/test/integration/app/generated_models/seller.rb +30 -0
  100. data/test/integration/app/generated_models/tabby.rb +26 -0
  101. data/test/integration/app/generated_models/user.rb +34 -0
  102. data/test/integration/app/generated_models/wild_boar.rb +87 -0
  103. data/test/integration/app/generators/commenting_generator_test.rb +83 -0
  104. data/test/integration/app/public/404.html +30 -0
  105. data/test/integration/app/public/500.html +30 -0
  106. data/test/integration/app/public/dispatch.cgi +10 -0
  107. data/test/integration/app/public/dispatch.fcgi +24 -0
  108. data/test/integration/app/public/dispatch.rb +10 -0
  109. data/test/integration/app/public/favicon.ico +0 -0
  110. data/test/integration/app/public/images/rails.png +0 -0
  111. data/test/integration/app/public/index.html +277 -0
  112. data/test/integration/app/public/javascripts/application.js +2 -0
  113. data/test/integration/app/public/javascripts/controls.js +833 -0
  114. data/test/integration/app/public/javascripts/dragdrop.js +942 -0
  115. data/test/integration/app/public/javascripts/effects.js +1088 -0
  116. data/test/integration/app/public/javascripts/prototype.js +2515 -0
  117. data/test/integration/app/public/robots.txt +1 -0
  118. data/test/integration/app/public/stylesheets/scaffold.css +74 -0
  119. data/test/integration/app/script/about +3 -0
  120. data/test/integration/app/script/breakpointer +3 -0
  121. data/test/integration/app/script/console +3 -0
  122. data/test/integration/app/script/destroy +3 -0
  123. data/test/integration/app/script/generate +3 -0
  124. data/test/integration/app/script/performance/benchmarker +3 -0
  125. data/test/integration/app/script/performance/profiler +3 -0
  126. data/test/integration/app/script/plugin +3 -0
  127. data/test/integration/app/script/process/inspector +3 -0
  128. data/test/integration/app/script/process/reaper +3 -0
  129. data/test/integration/app/script/process/spawner +3 -0
  130. data/test/integration/app/script/runner +3 -0
  131. data/test/integration/app/script/server +3 -0
  132. data/test/integration/app/test/fixtures/addresses.yml +13 -0
  133. data/test/integration/app/test/fixtures/citations.yml +9 -0
  134. data/test/integration/app/test/fixtures/citations_items.yml +9 -0
  135. data/test/integration/app/test/fixtures/sellers.yml +10 -0
  136. data/test/integration/app/test/fixtures/states.yml +216 -0
  137. data/test/integration/app/test/fixtures/users.yml +11 -0
  138. data/test/integration/app/test/functional/addresses_controller_test.rb +57 -0
  139. data/test/integration/app/test/functional/sellers_controller_test.rb +57 -0
  140. data/test/integration/app/test/functional/states_controller_test.rb +57 -0
  141. data/test/integration/app/test/functional/users_controller_test.rb +57 -0
  142. data/test/integration/app/test/test_helper.rb +28 -0
  143. data/test/integration/app/test/unit/address_test.rb +10 -0
  144. data/test/integration/app/test/unit/citation_test.rb +10 -0
  145. data/test/integration/app/test/unit/citations_item_test.rb +10 -0
  146. data/test/integration/app/test/unit/seller_test.rb +10 -0
  147. data/test/integration/app/test/unit/state_test.rb +10 -0
  148. data/test/integration/app/test/unit/user_test.rb +10 -0
  149. data/test/models/aquatic/fish.rb +2 -1
  150. data/test/models/aquatic/whale.rb +2 -0
  151. data/test/setup.rb +10 -0
  152. data/test/test_all.rb +16 -0
  153. data/test/test_helper.rb +16 -12
  154. data/test/unit/polymorph_test.rb +35 -34
  155. metadata +239 -98
  156. metadata.gz.sig +0 -0
@@ -0,0 +1,56 @@
1
+ #
2
+ # Sphinx/Ultrasphinx user-configurable options.
3
+ #
4
+ # Copy this file to RAILS_ROOT/config/ultrasphinx.
5
+ # You can use individual namespaces if you want (e.g. "development.base").
6
+ #
7
+
8
+ indexer
9
+ {
10
+ # Indexer running options
11
+ mem_limit = 256M
12
+ }
13
+
14
+ searchd
15
+ {
16
+ # Daemon options
17
+ # What interface the search daemon should listen on and where to store its logs
18
+ address = 0.0.0.0
19
+ port = 3313
20
+ log = /tmp/sphinx/searchd.log
21
+ query_log = /tmp/sphinx/query.log
22
+ read_timeout = 5
23
+ max_children = 300
24
+ pid_file = /tmp/sphinx/searchd.pid
25
+ max_matches = 100000
26
+ }
27
+
28
+ client
29
+ {
30
+ # Client options
31
+ dictionary_name = ts
32
+ # How your application connects to the search daemon (not necessarily the same as above)
33
+ server_host = localhost
34
+ server_port = 3313
35
+ }
36
+
37
+ source
38
+ {
39
+ # Individual SQL source options
40
+ sql_range_step = 20000
41
+ strip_html = 0
42
+ index_html_attrs =
43
+ sql_query_post =
44
+ }
45
+
46
+ index
47
+ {
48
+ # Index building options
49
+ path = /tmp/sphinx/
50
+ docinfo = extern # just leave this alone
51
+ morphology = stem_en
52
+ stopwords = # /path/to/stopwords.txt
53
+ min_word_len = 1
54
+ charset_type = utf-8 # or sbcs (Single Byte Character Set)
55
+ charset_table = 0..9, A..Z->a..z, -, _, ., &, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F,U+C5->U+E5, U+E5, U+C4->U+E4, U+E4, U+D6->U+F6, U+F6, U+16B, U+0c1->a, U+0c4->a, U+0c9->e, U+0cd->i, U+0d3->o, U+0d4->o, U+0da->u, U+0dd->y, U+0e1->a, U+0e4->a, U+0e9->e, U+0ed->i, U+0f3->o, U+0f4->o, U+0fa->u, U+0fd->y, U+104->U+105, U+105, U+106->U+107, U+10c->c, U+10d->c, U+10e->d, U+10f->d, U+116->U+117, U+117, U+118->U+119, U+11a->e, U+11b->e, U+12E->U+12F, U+12F, U+139->l, U+13a->l, U+13d->l, U+13e->l, U+141->U+142, U+142, U+143->U+144, U+144,U+147->n, U+148->n, U+154->r, U+155->r, U+158->r, U+159->r, U+15A->U+15B, U+15B, U+160->s, U+160->U+161, U+161->s, U+164->t, U+165->t, U+16A->U+16B, U+16B, U+16e->u, U+16f->u, U+172->U+173, U+173, U+179->U+17A, U+17A, U+17B->U+17C, U+17C, U+17d->z, U+17e->z,
56
+ }
@@ -0,0 +1,155 @@
1
+
2
+ # Auto-generated at Wed Oct 03 03:57:12 -0400 2007.
3
+ # Hand modifications will be overwritten.
4
+ # /Users/eweaver/Desktop/projects/chow/vendor/plugins/ultrasphinx/test/integration/app/config/ultrasphinx/default.base
5
+ indexer {
6
+ mem_limit = 256M
7
+ }
8
+ searchd {
9
+ read_timeout = 5
10
+ max_children = 300
11
+ log = /tmp/sphinx/searchd.log
12
+ port = 3313
13
+ max_matches = 100000
14
+ query_log = /tmp/sphinx/query.log
15
+ pid_file = /tmp/sphinx/searchd.pid
16
+ address = 0.0.0.0
17
+ }
18
+
19
+ # Source configuration
20
+
21
+ source geo__states
22
+ {
23
+ strip_html = 0
24
+ sql_range_step = 20000
25
+ index_html_attrs =
26
+ sql_query_post =
27
+
28
+ type = mysql
29
+ sql_query_pre = SET SESSION group_concat_max_len = 65535
30
+ sql_query_pre = SET NAMES utf8
31
+
32
+ sql_db = app_development
33
+ sql_host = localhost
34
+ sql_pass =
35
+ sql_user = root
36
+ sql_query_range = SELECT MIN(id), MAX(id) FROM states
37
+ sql_query = SELECT (states.id * 4 + 0) AS id, CAST(GROUP_CONCAT(addresses.name SEPARATOR ' ') AS CHAR) AS address_name, 0 AS capitalization, 'Geo::State' AS class, 0 AS class_id, '' AS company, '' AS company_name, 0 AS company_name_facet, '' AS content, UNIX_TIMESTAMP('1970-01-01 00:00:00') AS created_at, 0 AS deleted, '' AS email, '__empty_searchable__' AS empty_searchable, '' AS login, '' AS name, '' AS state, 0 AS user_id FROM states LEFT OUTER JOIN addresses ON states.id = addresses.state_id WHERE states.id >= $start AND states.id <= $end GROUP BY id
38
+
39
+ sql_group_column = capitalization
40
+ sql_group_column = class_id
41
+ sql_group_column = company_name_facet
42
+ sql_date_column = created_at
43
+ sql_group_column = deleted
44
+ sql_group_column = user_id
45
+ sql_query_info = SELECT * FROM states WHERE states.id = (($id - 0) / 4)
46
+ }
47
+
48
+
49
+ # Source configuration
50
+
51
+ source sellers
52
+ {
53
+ strip_html = 0
54
+ sql_range_step = 20000
55
+ index_html_attrs =
56
+ sql_query_post =
57
+
58
+ type = mysql
59
+ sql_query_pre = SET SESSION group_concat_max_len = 65535
60
+ sql_query_pre = SET NAMES utf8
61
+
62
+ sql_db = app_development
63
+ sql_host = localhost
64
+ sql_pass =
65
+ sql_user = root
66
+ sql_query_range = SELECT MIN(id), MAX(id) FROM sellers
67
+ sql_query = SELECT (sellers.id * 4 + 1) AS id, '' AS address_name, sellers.capitalization AS capitalization, 'Seller' AS class, 1 AS class_id, '' AS company, sellers.company_name AS company_name, CRC32(sellers.company_name) AS company_name_facet, '' AS content, UNIX_TIMESTAMP(sellers.created_at) AS created_at, 0 AS deleted, '' AS email, '__empty_searchable__' AS empty_searchable, '' AS login, '' AS name, '' AS state, sellers.user_id AS user_id FROM sellers WHERE sellers.id >= $start AND sellers.id <= $end GROUP BY id
68
+
69
+ sql_group_column = capitalization
70
+ sql_group_column = class_id
71
+ sql_group_column = company_name_facet
72
+ sql_date_column = created_at
73
+ sql_group_column = deleted
74
+ sql_group_column = user_id
75
+ sql_query_info = SELECT * FROM sellers WHERE sellers.id = (($id - 1) / 4)
76
+ }
77
+
78
+
79
+ # Source configuration
80
+
81
+ source geo__addresses
82
+ {
83
+ strip_html = 0
84
+ sql_range_step = 20000
85
+ index_html_attrs =
86
+ sql_query_post =
87
+
88
+ type = mysql
89
+ sql_query_pre = SET SESSION group_concat_max_len = 65535
90
+ sql_query_pre = SET NAMES utf8
91
+
92
+ sql_db = app_development
93
+ sql_host = localhost
94
+ sql_pass =
95
+ sql_user = root
96
+ sql_query_range = SELECT MIN(id), MAX(id) FROM addresses
97
+ sql_query = SELECT (addresses.id * 4 + 2) AS id, '' AS address_name, 0 AS capitalization, 'Geo::Address' AS class, 2 AS class_id, '' AS company, '' AS company_name, 0 AS company_name_facet, CONCAT_WS(' ', addresses.line_1, addresses.line_2, addresses.city, addresses.province_region, addresses.zip_postal_code) AS content, UNIX_TIMESTAMP('1970-01-01 00:00:00') AS created_at, 0 AS deleted, '' AS email, '__empty_searchable__' AS empty_searchable, '' AS login, addresses.name AS name, states.name AS state, 0 AS user_id FROM addresses LEFT OUTER JOIN states ON states.id = addresses.state_id WHERE addresses.id >= $start AND addresses.id <= $end GROUP BY id
98
+
99
+ sql_group_column = capitalization
100
+ sql_group_column = class_id
101
+ sql_group_column = company_name_facet
102
+ sql_date_column = created_at
103
+ sql_group_column = deleted
104
+ sql_group_column = user_id
105
+ sql_query_info = SELECT * FROM addresses WHERE addresses.id = (($id - 2) / 4)
106
+ }
107
+
108
+
109
+ # Source configuration
110
+
111
+ source users
112
+ {
113
+ strip_html = 0
114
+ sql_range_step = 20000
115
+ index_html_attrs =
116
+ sql_query_post =
117
+
118
+ type = mysql
119
+ sql_query_pre = SET SESSION group_concat_max_len = 65535
120
+ sql_query_pre = SET NAMES utf8
121
+
122
+ sql_db = app_development
123
+ sql_host = localhost
124
+ sql_pass =
125
+ sql_user = root
126
+ sql_query_range = SELECT MIN(id), MAX(id) FROM users
127
+ sql_query = SELECT (users.id * 4 + 3) AS id, '' AS address_name, 0 AS capitalization, 'User' AS class, 3 AS class_id, sellers.company_name AS company, '' AS company_name, 0 AS company_name_facet, '' AS content, UNIX_TIMESTAMP('1970-01-01 00:00:00') AS created_at, users.deleted AS deleted, users.email AS email, '__empty_searchable__' AS empty_searchable, users.login AS login, '' AS name, '' AS state, 0 AS user_id FROM users LEFT OUTER JOIN sellers ON users.id = sellers.user_id WHERE users.id >= $start AND users.id <= $end AND (deleted = 0) GROUP BY id
128
+
129
+ sql_group_column = capitalization
130
+ sql_group_column = class_id
131
+ sql_group_column = company_name_facet
132
+ sql_date_column = created_at
133
+ sql_group_column = deleted
134
+ sql_group_column = user_id
135
+ sql_query_info = SELECT * FROM users WHERE users.id = (($id - 3) / 4)
136
+ }
137
+
138
+
139
+ # Index configuration
140
+
141
+ index complete
142
+ {
143
+ source = geo__addresses
144
+ source = geo__states
145
+ source = sellers
146
+ source = users
147
+ charset_type = utf-8
148
+ charset_table = 0..9, A..Z->a..z, -, _, ., &, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F,U+C5->U+E5, U+E5, U+C4->U+E4, U+E4, U+D6->U+F6, U+F6, U+16B, U+0c1->a, U+0c4->a, U+0c9->e, U+0cd->i, U+0d3->o, U+0d4->o, U+0da->u, U+0dd->y, U+0e1->a, U+0e4->a, U+0e9->e, U+0ed->i, U+0f3->o, U+0f4->o, U+0fa->u, U+0fd->y, U+104->U+105, U+105, U+106->U+107, U+10c->c, U+10d->c, U+10e->d, U+10f->d, U+116->U+117, U+117, U+118->U+119, U+11a->e, U+11b->e, U+12E->U+12F, U+12F, U+139->l, U+13a->l, U+13d->l, U+13e->l, U+141->U+142, U+142, U+143->U+144, U+144,U+147->n, U+148->n, U+154->r, U+155->r, U+158->r, U+159->r, U+15A->U+15B, U+15B, U+160->s, U+160->U+161, U+161->s, U+164->t, U+165->t, U+16A->U+16B, U+16B, U+16e->u, U+16f->u, U+172->U+173, U+173, U+179->U+17A, U+17A, U+17B->U+17C, U+17C, U+17d->z, U+17e->z,
149
+ min_word_len = 1
150
+ stopwords =
151
+ path = /tmp/sphinx//sphinx_index_complete
152
+ docinfo = extern
153
+ morphology = stem_en
154
+ }
155
+
@@ -0,0 +1,16 @@
1
+ class CreateUsers < ActiveRecord::Migration
2
+ def self.up
3
+ create_table "users", :force => true do |t|
4
+ t.string "login", :limit => 64, :default => "", :null => false
5
+ t.string "email", :default => "", :null => false
6
+ t.string "crypted_password", :limit => 64, :default => "", :null => false
7
+ t.string "salt", :limit => 64, :default => "", :null => false
8
+ t.datetime "created_at"
9
+ t.datetime "updated_at"
10
+ end
11
+ end
12
+
13
+ def self.down
14
+ drop_table :users
15
+ end
16
+ end
@@ -0,0 +1,14 @@
1
+ class CreateSellers < ActiveRecord::Migration
2
+ def self.up
3
+ create_table "sellers", :force => true do |t|
4
+ t.integer "user_id", :null => false
5
+ t.string "company_name"
6
+ t.datetime "created_at"
7
+ t.datetime "updated_at"
8
+ end
9
+ end
10
+
11
+ def self.down
12
+ drop_table :sellers
13
+ end
14
+ end
@@ -0,0 +1,19 @@
1
+ class CreateAddresses < ActiveRecord::Migration
2
+ def self.up
3
+ create_table "addresses", :force => true do |t|
4
+ t.integer "user_id", :null => false
5
+ t.string "name"
6
+ t.string "line_1", :default => "", :null => false
7
+ t.string "line_2"
8
+ t.string "city", :default => "", :null => false
9
+ t.integer "state_id", :null => false
10
+ t.string "province_region"
11
+ t.string "zip_postal_code"
12
+ t.integer "country_id", :null => false
13
+ end
14
+ end
15
+
16
+ def self.down
17
+ drop_table :addresses
18
+ end
19
+ end
@@ -0,0 +1,12 @@
1
+ class CreateStates < ActiveRecord::Migration
2
+ def self.up
3
+ create_table "states", :force => true do |t|
4
+ t.string "name", :default => "", :null => false
5
+ t.string "abbreviation", :default => "", :null => false
6
+ end
7
+ end
8
+
9
+ def self.down
10
+ drop_table "states"
11
+ end
12
+ end
@@ -0,0 +1,9 @@
1
+ class AddCapitalizationToSeller < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :sellers, :capitalization, :float, :default => 0.0
4
+ end
5
+
6
+ def self.down
7
+ remove_column :sellers, :capitalization
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class AddDeletedToUser < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :users, :deleted, :boolean, :default => false
4
+ end
5
+
6
+ def self.down
7
+ remove_column :users, :deleted
8
+ end
9
+ end
@@ -0,0 +1,11 @@
1
+ class AddLatAndLongToAddress < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :addresses, :lat, :float
4
+ add_column :addresses, :long, :float
5
+ end
6
+
7
+ def self.down
8
+ remove_column :addresses, :lat
9
+ remove_column :addresses, :long
10
+ end
11
+ end
@@ -0,0 +1,12 @@
1
+ class CreateCitations < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :citations do |t|
4
+ t.string :name
5
+ t.timestamps
6
+ end
7
+ end
8
+
9
+ def self.down
10
+ drop_table :citations
11
+ end
12
+ end
@@ -0,0 +1,14 @@
1
+ class CreateCitationsItems < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :citations_items do |t|
4
+ t.integer :citation_id, :null => false
5
+ t.integer :item_id, :null => false
6
+ t.string :item_type, :null => false
7
+ t.timestamps
8
+ end
9
+ end
10
+
11
+ def self.down
12
+ drop_table :citations_items
13
+ end
14
+ end
@@ -0,0 +1,144 @@
1
+ # This file is autogenerated. Instead of editing this file, please use the
2
+ # migrations feature of ActiveRecord to incrementally modify your database, and
3
+ # then regenerate this schema definition.
4
+
5
+ ActiveRecord::Schema.define(:version => 9) do
6
+
7
+ create_table "addresses", :force => true do |t|
8
+ t.integer "user_id", :null => false
9
+ t.string "name"
10
+ t.string "line_1", :default => "", :null => false
11
+ t.string "line_2"
12
+ t.string "city", :default => "", :null => false
13
+ t.integer "state_id", :null => false
14
+ t.string "province_region"
15
+ t.string "zip_postal_code"
16
+ t.integer "country_id", :null => false
17
+ t.float "lat"
18
+ t.float "long"
19
+ end
20
+
21
+ create_table "bow_wows", :force => true do |t|
22
+ t.string "name"
23
+ t.datetime "created_at", :null => false
24
+ t.datetime "updated_at", :null => false
25
+ end
26
+
27
+ create_table "cats", :force => true do |t|
28
+ t.string "name"
29
+ t.string "cat_type"
30
+ t.datetime "created_at", :null => false
31
+ t.datetime "updated_at", :null => false
32
+ end
33
+
34
+ create_table "citations", :force => true do |t|
35
+ t.string "name"
36
+ t.datetime "created_at"
37
+ t.datetime "updated_at"
38
+ end
39
+
40
+ create_table "citations_items", :force => true do |t|
41
+ t.integer "citation_id", :null => false
42
+ t.integer "item_id", :null => false
43
+ t.string "item_type", :default => "", :null => false
44
+ t.datetime "created_at"
45
+ t.datetime "updated_at"
46
+ end
47
+
48
+ create_table "eaters_foodstuffs", :force => true do |t|
49
+ t.integer "foodstuff_id"
50
+ t.integer "eater_id"
51
+ t.integer "some_attribute", :default => 0
52
+ t.string "eater_type"
53
+ t.datetime "created_at", :null => false
54
+ t.datetime "updated_at", :null => false
55
+ end
56
+
57
+ create_table "fish", :force => true do |t|
58
+ t.string "name"
59
+ t.integer "speed"
60
+ t.datetime "created_at", :null => false
61
+ t.datetime "updated_at", :null => false
62
+ end
63
+
64
+ create_table "frogs", :force => true do |t|
65
+ t.string "name"
66
+ t.datetime "created_at", :null => false
67
+ t.datetime "updated_at", :null => false
68
+ end
69
+
70
+ create_table "keep_your_enemies_close", :force => true do |t|
71
+ t.integer "enemy_id"
72
+ t.string "enemy_type"
73
+ t.integer "protector_id"
74
+ t.string "protector_type"
75
+ t.datetime "created_at", :null => false
76
+ t.datetime "updated_at", :null => false
77
+ end
78
+
79
+ create_table "little_whale_pupils", :force => true do |t|
80
+ t.integer "whale_id"
81
+ t.integer "aquatic_pupil_id"
82
+ t.string "aquatic_pupil_type"
83
+ t.datetime "created_at", :null => false
84
+ t.datetime "updated_at", :null => false
85
+ end
86
+
87
+ create_table "parentships", :force => true do |t|
88
+ t.integer "parent_id"
89
+ t.string "child_type"
90
+ t.integer "kid_id"
91
+ t.datetime "created_at", :null => false
92
+ t.datetime "updated_at", :null => false
93
+ end
94
+
95
+ create_table "people", :force => true do |t|
96
+ t.string "name"
97
+ t.integer "age"
98
+ t.datetime "created_at", :null => false
99
+ t.datetime "updated_at", :null => false
100
+ end
101
+
102
+ create_table "petfoods", :id => false, :force => true do |t|
103
+ t.integer "the_petfood_primary_key", :null => false
104
+ t.string "name"
105
+ t.datetime "created_at", :null => false
106
+ t.datetime "updated_at", :null => false
107
+ end
108
+
109
+ create_table "sellers", :force => true do |t|
110
+ t.integer "user_id", :null => false
111
+ t.string "company_name"
112
+ t.datetime "created_at"
113
+ t.datetime "updated_at"
114
+ t.float "capitalization", :default => 0.0
115
+ end
116
+
117
+ create_table "states", :force => true do |t|
118
+ t.string "name", :default => "", :null => false
119
+ t.string "abbreviation", :default => "", :null => false
120
+ end
121
+
122
+ create_table "users", :force => true do |t|
123
+ t.string "login", :limit => 64, :default => "", :null => false
124
+ t.string "email", :default => "", :null => false
125
+ t.string "crypted_password", :limit => 64, :default => "", :null => false
126
+ t.string "salt", :limit => 64, :default => "", :null => false
127
+ t.datetime "created_at"
128
+ t.datetime "updated_at"
129
+ t.boolean "deleted", :default => false
130
+ end
131
+
132
+ create_table "whales", :force => true do |t|
133
+ t.string "name"
134
+ t.datetime "created_at", :null => false
135
+ t.datetime "updated_at", :null => false
136
+ end
137
+
138
+ create_table "wild_boars", :force => true do |t|
139
+ t.string "name"
140
+ t.datetime "created_at", :null => false
141
+ t.datetime "updated_at", :null => false
142
+ end
143
+
144
+ end