has_many_polymorphs 2.10 → 2.11

Sign up to get free protection for your applications and to get access to all the features.
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,78 @@
1
+
2
+ class Frog
3
+
4
+ has_many_polymorphs :protectors,
5
+ :singular_reverse_association_id => :enemy,
6
+ :extend => #<Proc:0x03be68bc@/Users/eweaver/Desktop/projects/fauna/has_many_polymorphs/trunk/test/models/beautiful_fight_relationship.rb:15>,
7
+ :foreign_key => "enemy_id",
8
+ :is_double => true,
9
+ :from => [:wild_boars,
10
+ :kittens,
11
+ :"aquatic/fish",
12
+ :dogs],
13
+ :through => :beautiful_fight_relationships,
14
+ :foreign_type_key => "enemy_type",
15
+ :join_extend => [#<Proc:0x03be672c@/Users/eweaver/Desktop/projects/fauna/has_many_polymorphs/trunk/test/models/beautiful_fight_relationship.rb:20>],
16
+ :conflicts => [:kittens,
17
+ :dogs],
18
+ :as => :enemy
19
+ # called from line 57
20
+
21
+ has_many :beautiful_fight_relationships_as_enemy,
22
+ :extend => [Frog::FrogProtectorPolymorphicJoinAssociationExtension0],
23
+ :dependent => :destroy,
24
+ :foreign_key => "enemy_id",
25
+ :conditions => "enemy_type = 'Frog'",
26
+ :as => :enemy,
27
+ :class_name => "BeautifulFightRelationship"
28
+ # called from line 57
29
+
30
+ has_many :kittens,
31
+ :source => :protector,
32
+ :extend => [Frog::FrogKittenPolymorphicChildAssociationExtension, Frog::FrogProtectorPolymorphicAssociationExtension0],
33
+ :limit => nil,
34
+ :through => :beautiful_fight_relationships_as_enemy,
35
+ :group => nil,
36
+ :conditions => nil,
37
+ :source_type => "Cat",
38
+ :class_name => "Kitten",
39
+ :order => nil
40
+ # called from line 57
41
+
42
+ has_many :aquatic_fish,
43
+ :source => :protector,
44
+ :extend => [Frog::FrogAquaticFishPolymorphicChildAssociationExtension, Frog::FrogProtectorPolymorphicAssociationExtension0],
45
+ :limit => nil,
46
+ :through => :beautiful_fight_relationships_as_enemy,
47
+ :group => nil,
48
+ :conditions => nil,
49
+ :source_type => "Aquatic::Fish",
50
+ :class_name => "Aquatic::Fish",
51
+ :order => nil
52
+ # called from line 57
53
+
54
+ has_many :wild_boars,
55
+ :source => :protector,
56
+ :extend => [Frog::FrogWildBoarPolymorphicChildAssociationExtension, Frog::FrogProtectorPolymorphicAssociationExtension0],
57
+ :limit => nil,
58
+ :through => :beautiful_fight_relationships_as_enemy,
59
+ :group => nil,
60
+ :conditions => nil,
61
+ :source_type => "WildBoar",
62
+ :class_name => "WildBoar",
63
+ :order => nil
64
+ # called from line 57
65
+
66
+ has_many :dogs,
67
+ :source => :protector,
68
+ :extend => [Frog::FrogDogPolymorphicChildAssociationExtension, Frog::FrogProtectorPolymorphicAssociationExtension0],
69
+ :limit => nil,
70
+ :through => :beautiful_fight_relationships_as_enemy,
71
+ :group => nil,
72
+ :conditions => nil,
73
+ :source_type => "Dog",
74
+ :class_name => "Dog",
75
+ :order => nil
76
+ # called from line 57
77
+
78
+ end
@@ -0,0 +1,161 @@
1
+
2
+ class Kitten
3
+
4
+ has_many_polymorphs :enemies,
5
+ :singular_reverse_association_id => :protector,
6
+ :extend => [ExtensionModule, #<Proc:0x00000000@/Users/eweaver/Desktop/projects/fauna/has_many_polymorphs/trunk/test/models/beautiful_fight_relationship.rb:14>],
7
+ :foreign_key => "protector_id",
8
+ :is_double => true,
9
+ :from => [:dogs,
10
+ :kittens,
11
+ :frogs],
12
+ :through => :beautiful_fight_relationships,
13
+ :foreign_type_key => "protector_type",
14
+ :join_extend => [#<Proc:0x03be672c@/Users/eweaver/Desktop/projects/fauna/has_many_polymorphs/trunk/test/models/beautiful_fight_relationship.rb:20>],
15
+ :conflicts => [:dogs,
16
+ :kittens],
17
+ :as => :protector
18
+ # called from line 57
19
+
20
+ has_many :beautiful_fight_relationships_as_protector,
21
+ :extend => [Kitten::KittenEnemyPolymorphicJoinAssociationExtension0],
22
+ :dependent => :destroy,
23
+ :foreign_key => "protector_id",
24
+ :conditions => "protector_type = 'Cat'",
25
+ :as => :protector,
26
+ :class_name => "BeautifulFightRelationship"
27
+ # called from line 57
28
+
29
+ has_many :frogs,
30
+ :source => :enemy,
31
+ :extend => [Kitten::KittenFrogPolymorphicChildAssociationExtension, ExtensionModule, Kitten::KittenEnemyPolymorphicAssociationExtension0],
32
+ :limit => nil,
33
+ :through => :beautiful_fight_relationships_as_protector,
34
+ :group => nil,
35
+ :conditions => nil,
36
+ :source_type => "Frog",
37
+ :class_name => "Frog",
38
+ :order => nil
39
+ # called from line 57
40
+
41
+ has_many :enemy_kittens,
42
+ :source => :enemy,
43
+ :extend => [Kitten::KittenEnemyKittenPolymorphicChildAssociationExtension, ExtensionModule, Kitten::KittenEnemyPolymorphicAssociationExtension0],
44
+ :limit => nil,
45
+ :through => :beautiful_fight_relationships_as_protector,
46
+ :group => nil,
47
+ :conditions => nil,
48
+ :source_type => "Cat",
49
+ :class_name => "Kitten",
50
+ :order => nil
51
+ # called from line 57
52
+
53
+ has_many :enemy_dogs,
54
+ :source => :enemy,
55
+ :extend => [Kitten::KittenEnemyDogPolymorphicChildAssociationExtension, ExtensionModule, Kitten::KittenEnemyPolymorphicAssociationExtension0],
56
+ :limit => nil,
57
+ :through => :beautiful_fight_relationships_as_protector,
58
+ :group => nil,
59
+ :conditions => nil,
60
+ :source_type => "Dog",
61
+ :class_name => "Dog",
62
+ :order => nil
63
+ # called from line 57
64
+
65
+ has_many_polymorphs :protectors,
66
+ :singular_reverse_association_id => :enemy,
67
+ :extend => #<Proc:0x03be68bc@/Users/eweaver/Desktop/projects/fauna/has_many_polymorphs/trunk/test/models/beautiful_fight_relationship.rb:15>,
68
+ :foreign_key => "enemy_id",
69
+ :is_double => true,
70
+ :from => [:wild_boars,
71
+ :kittens,
72
+ :"aquatic/fish",
73
+ :dogs],
74
+ :through => :beautiful_fight_relationships,
75
+ :foreign_type_key => "enemy_type",
76
+ :join_extend => [#<Proc:0x03be672c@/Users/eweaver/Desktop/projects/fauna/has_many_polymorphs/trunk/test/models/beautiful_fight_relationship.rb:20>],
77
+ :conflicts => [:kittens,
78
+ :dogs],
79
+ :as => :enemy
80
+ # called from line 57
81
+
82
+ has_many :beautiful_fight_relationships_as_enemy,
83
+ :extend => [Kitten::KittenProtectorPolymorphicJoinAssociationExtension0],
84
+ :dependent => :destroy,
85
+ :foreign_key => "enemy_id",
86
+ :conditions => "enemy_type = 'Cat'",
87
+ :as => :enemy,
88
+ :class_name => "BeautifulFightRelationship"
89
+ # called from line 57
90
+
91
+ has_many :protector_kittens,
92
+ :source => :protector,
93
+ :extend => [Kitten::KittenProtectorKittenPolymorphicChildAssociationExtension, Kitten::KittenProtectorPolymorphicAssociationExtension0],
94
+ :limit => nil,
95
+ :through => :beautiful_fight_relationships_as_enemy,
96
+ :group => nil,
97
+ :conditions => nil,
98
+ :source_type => "Cat",
99
+ :class_name => "Kitten",
100
+ :order => nil
101
+ # called from line 57
102
+
103
+ has_many :aquatic_fish,
104
+ :source => :protector,
105
+ :extend => [Kitten::KittenAquaticFishPolymorphicChildAssociationExtension, Kitten::KittenProtectorPolymorphicAssociationExtension0],
106
+ :limit => nil,
107
+ :through => :beautiful_fight_relationships_as_enemy,
108
+ :group => nil,
109
+ :conditions => nil,
110
+ :source_type => "Aquatic::Fish",
111
+ :class_name => "Aquatic::Fish",
112
+ :order => nil
113
+ # called from line 57
114
+
115
+ has_many :wild_boars,
116
+ :source => :protector,
117
+ :extend => [Kitten::KittenWildBoarPolymorphicChildAssociationExtension, Kitten::KittenProtectorPolymorphicAssociationExtension0],
118
+ :limit => nil,
119
+ :through => :beautiful_fight_relationships_as_enemy,
120
+ :group => nil,
121
+ :conditions => nil,
122
+ :source_type => "WildBoar",
123
+ :class_name => "WildBoar",
124
+ :order => nil
125
+ # called from line 57
126
+
127
+ has_many :protector_dogs,
128
+ :source => :protector,
129
+ :extend => [Kitten::KittenProtectorDogPolymorphicChildAssociationExtension, Kitten::KittenProtectorPolymorphicAssociationExtension0],
130
+ :limit => nil,
131
+ :through => :beautiful_fight_relationships_as_enemy,
132
+ :group => nil,
133
+ :conditions => nil,
134
+ :source_type => "Dog",
135
+ :class_name => "Dog",
136
+ :order => nil
137
+ # called from line 57
138
+
139
+ has_many :eaters_foodstuffs,
140
+ :extend => [Petfood::PetfoodEaterPolymorphicJoinAssociationExtension0],
141
+ :dependent => :destroy,
142
+ :conditions => "NULL IS NULL OR NULL != 'Snausages'",
143
+ :as => :eater,
144
+ :class_name => "EatersFoodstuff",
145
+ :order => "NULL DESC"
146
+ # called from line 57
147
+
148
+ has_many :foodstuffs_of_eaters,
149
+ :source => :foodstuff,
150
+ :extend => [Petfood::PetfoodEaterPolymorphicParentAssociationExtension0],
151
+ :foreign_key => "foodstuff_id",
152
+ :limit => nil,
153
+ :through => :eaters_foodstuffs,
154
+ :group => nil,
155
+ :conditions => "petfoods.name IS NULL OR petfoods.name != 'Snausages'",
156
+ :offset => nil,
157
+ :class_name => "Petfood",
158
+ :order => "petfoods.the_petfood_primary_key DESC"
159
+ # called from line 57
160
+
161
+ end
@@ -0,0 +1,14 @@
1
+
2
+ class Parentship
3
+
4
+ belongs_to :parent,
5
+ :foreign_key => "parent_id",
6
+ :class_name => "Person"
7
+ # called from line 57
8
+
9
+ belongs_to :kid,
10
+ :foreign_type => "child_type",
11
+ :polymorphic => true
12
+ # called from line 57
13
+
14
+ end
@@ -0,0 +1,53 @@
1
+
2
+ class Person
3
+
4
+ has_many_polymorphs :kids,
5
+ :polymorphic_type_key => "child_type",
6
+ :from => [:people],
7
+ :through => :parentships,
8
+ :conditions => "people.age < 10",
9
+ :as => :parent
10
+ # called from line 57
11
+
12
+ has_many :parentships,
13
+ :extend => [],
14
+ :dependent => :destroy,
15
+ :foreign_key => "parent_id",
16
+ :class_name => "Parentship"
17
+ # called from line 57
18
+
19
+ has_many :people,
20
+ :source => :kid,
21
+ :extend => [Person::PersonPersonPolymorphicChildAssociationExtension],
22
+ :limit => nil,
23
+ :through => :parentships,
24
+ :group => nil,
25
+ :conditions => "people.age < 10",
26
+ :source_type => "Person",
27
+ :class_name => "Person",
28
+ :order => nil
29
+ # called from line 57
30
+
31
+ has_many :parentships_as_child,
32
+ :extend => [],
33
+ :dependent => :destroy,
34
+ :conditions => nil,
35
+ :as => :kid,
36
+ :class_name => "Parentship",
37
+ :order => nil
38
+ # called from line 57
39
+
40
+ has_many :parents,
41
+ :source => :parent,
42
+ :extend => [],
43
+ :foreign_key => "parent_id",
44
+ :limit => nil,
45
+ :through => :parentships_as_child,
46
+ :group => nil,
47
+ :conditions => nil,
48
+ :offset => nil,
49
+ :class_name => "Person",
50
+ :order => nil
51
+ # called from line 57
52
+
53
+ end
@@ -0,0 +1,125 @@
1
+
2
+ class Petfood
3
+
4
+ has_many_polymorphs :eaters,
5
+ :parent_extend => #<Proc:0x03ab5998@/Users/eweaver/Desktop/projects/fauna/has_many_polymorphs/trunk/test/models/petfood.rb:34>,
6
+ :extend => [ExtensionModule, OtherExtensionModule, #<Proc:0x00000000@/Users/eweaver/Desktop/projects/fauna/has_many_polymorphs/trunk/test/models/petfood.rb:28>],
7
+ :parent_conditions => "petfoods.name IS NULL OR petfoods.name != 'Snausages'",
8
+ :foreign_key => "foodstuff_id",
9
+ :parent_order => "petfoods.the_petfood_primary_key DESC",
10
+ :from => [:dogs,
11
+ :petfoods,
12
+ :wild_boars,
13
+ :kittens,
14
+ :tabbies,
15
+ :"aquatic/fish"],
16
+ :join_extend => #<Proc:0x03ab5b28@/Users/eweaver/Desktop/projects/fauna/has_many_polymorphs/trunk/test/models/petfood.rb:29>,
17
+ :conditions => "NULL IS NULL",
18
+ :as => :foodstuff,
19
+ :ignore_duplicates => false,
20
+ :rename_individual_collections => true,
21
+ :order => "eaters_foodstuffs.updated_at ASC"
22
+ # called from line 57
23
+
24
+ has_many :eaters_foodstuffs,
25
+ :extend => [Petfood::PetfoodEaterPolymorphicJoinAssociationExtension0],
26
+ :dependent => :destroy,
27
+ :foreign_key => "foodstuff_id",
28
+ :class_name => "EatersFoodstuff"
29
+ # called from line 57
30
+
31
+ has_many :eater_tabbies,
32
+ :source => :eater,
33
+ :extend => [Petfood::PetfoodEaterTabbyPolymorphicChildAssociationExtension, ExtensionModule, OtherExtensionModule, Petfood::PetfoodEaterPolymorphicAssociationExtension0],
34
+ :limit => nil,
35
+ :through => :eaters_foodstuffs,
36
+ :group => nil,
37
+ :conditions => "NULL IS NULL",
38
+ :source_type => "Cat",
39
+ :class_name => "Tabby",
40
+ :order => "eaters_foodstuffs.updated_at ASC"
41
+ # called from line 57
42
+
43
+ has_many :eater_kittens,
44
+ :source => :eater,
45
+ :extend => [Petfood::PetfoodEaterKittenPolymorphicChildAssociationExtension, ExtensionModule, OtherExtensionModule, Petfood::PetfoodEaterPolymorphicAssociationExtension0],
46
+ :limit => nil,
47
+ :through => :eaters_foodstuffs,
48
+ :group => nil,
49
+ :conditions => "NULL IS NULL",
50
+ :source_type => "Cat",
51
+ :class_name => "Kitten",
52
+ :order => "eaters_foodstuffs.updated_at ASC"
53
+ # called from line 57
54
+
55
+ has_many :eater_aquatic_fish,
56
+ :source => :eater,
57
+ :extend => [Petfood::PetfoodEaterAquaticFishPolymorphicChildAssociationExtension, ExtensionModule, OtherExtensionModule, Petfood::PetfoodEaterPolymorphicAssociationExtension0],
58
+ :limit => nil,
59
+ :through => :eaters_foodstuffs,
60
+ :group => nil,
61
+ :conditions => "NULL IS NULL",
62
+ :source_type => "Aquatic::Fish",
63
+ :class_name => "Aquatic::Fish",
64
+ :order => "eaters_foodstuffs.updated_at ASC"
65
+ # called from line 57
66
+
67
+ has_many :eater_wild_boars,
68
+ :source => :eater,
69
+ :extend => [Petfood::PetfoodEaterWildBoarPolymorphicChildAssociationExtension, ExtensionModule, OtherExtensionModule, Petfood::PetfoodEaterPolymorphicAssociationExtension0],
70
+ :limit => nil,
71
+ :through => :eaters_foodstuffs,
72
+ :group => nil,
73
+ :conditions => "NULL IS NULL",
74
+ :source_type => "WildBoar",
75
+ :class_name => "WildBoar",
76
+ :order => "eaters_foodstuffs.updated_at ASC"
77
+ # called from line 57
78
+
79
+ has_many :eater_petfoods,
80
+ :source => :eater,
81
+ :extend => [Petfood::PetfoodEaterPetfoodPolymorphicChildAssociationExtension, ExtensionModule, OtherExtensionModule, Petfood::PetfoodEaterPolymorphicAssociationExtension0],
82
+ :limit => nil,
83
+ :through => :eaters_foodstuffs,
84
+ :group => nil,
85
+ :conditions => "NULL IS NULL",
86
+ :source_type => "Petfood",
87
+ :class_name => "Petfood",
88
+ :order => "eaters_foodstuffs.updated_at ASC"
89
+ # called from line 57
90
+
91
+ has_many :eater_dogs,
92
+ :source => :eater,
93
+ :extend => [Petfood::PetfoodEaterDogPolymorphicChildAssociationExtension, ExtensionModule, OtherExtensionModule, Petfood::PetfoodEaterPolymorphicAssociationExtension0],
94
+ :limit => nil,
95
+ :through => :eaters_foodstuffs,
96
+ :group => nil,
97
+ :conditions => "NULL IS NULL",
98
+ :source_type => "Dog",
99
+ :class_name => "Dog",
100
+ :order => "eaters_foodstuffs.updated_at ASC"
101
+ # called from line 57
102
+
103
+ has_many :eaters_foodstuffs_as_child,
104
+ :extend => [Petfood::PetfoodEaterPolymorphicJoinAssociationExtension0],
105
+ :dependent => :destroy,
106
+ :conditions => "NULL IS NULL OR NULL != 'Snausages'",
107
+ :as => :eater,
108
+ :class_name => "EatersFoodstuff",
109
+ :order => "NULL DESC"
110
+ # called from line 57
111
+
112
+ has_many :foodstuffs_of_eaters,
113
+ :source => :foodstuff,
114
+ :extend => [Petfood::PetfoodEaterPolymorphicParentAssociationExtension0],
115
+ :foreign_key => "foodstuff_id",
116
+ :limit => nil,
117
+ :through => :eaters_foodstuffs_as_child,
118
+ :group => nil,
119
+ :conditions => "petfoods.name IS NULL OR petfoods.name != 'Snausages'",
120
+ :offset => nil,
121
+ :class_name => "Petfood",
122
+ :order => "petfoods.the_petfood_primary_key DESC"
123
+ # called from line 57
124
+
125
+ end
@@ -0,0 +1,25 @@
1
+
2
+ class PolymorphTest::SomeModel
3
+
4
+ has_many_polymorphs :polymorphs,
5
+ :from => [:fish]
6
+ # called from line 57
7
+
8
+ has_many_polymorphs :polymorphs,
9
+ :from => [:dog,
10
+ :cats]
11
+ # called from line 57
12
+
13
+ has_many_polymorphs :polymorph,
14
+ :from => [:dogs,
15
+ :cats]
16
+ # called from line 57
17
+
18
+ acts_as_double_polymorphic_join ,
19
+ :unimorphs => [:dogs,
20
+ :cats],
21
+ :polymorph => [:dogs,
22
+ :cats]
23
+ # called from line 57
24
+
25
+ end