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,2 @@
1
+ Use this README file to introduce your application and point to useful places in the API for learning more.
2
+ Run "rake appdoc" to generate API documentation for your models and controllers.
@@ -0,0 +1,109 @@
1
+
2
+ class Aquatic::Fish
3
+
4
+ has_many :aquatic_pupils_whales,
5
+ :extend => [],
6
+ :dependent => :destroy,
7
+ :conditions => nil,
8
+ :as => :aquatic_pupil,
9
+ :class_name => "Aquatic::PupilsWhale",
10
+ :order => nil
11
+ # called from line 57
12
+
13
+ has_many :whales,
14
+ :source => :whale,
15
+ :extend => [],
16
+ :foreign_key => "whale_id",
17
+ :limit => nil,
18
+ :through => :aquatic_pupils_whales,
19
+ :group => nil,
20
+ :conditions => nil,
21
+ :offset => nil,
22
+ :class_name => "Aquatic::Whale",
23
+ :order => nil
24
+ # called from line 57
25
+
26
+ has_many_polymorphs :enemies,
27
+ :singular_reverse_association_id => :protector,
28
+ :extend => [ExtensionModule, #<Proc:0x00000000@/Users/eweaver/Desktop/projects/fauna/has_many_polymorphs/trunk/test/models/beautiful_fight_relationship.rb:14>],
29
+ :foreign_key => "protector_id",
30
+ :is_double => true,
31
+ :from => [:dogs,
32
+ :kittens,
33
+ :frogs],
34
+ :through => :beautiful_fight_relationships,
35
+ :foreign_type_key => "protector_type",
36
+ :join_extend => [#<Proc:0x03be672c@/Users/eweaver/Desktop/projects/fauna/has_many_polymorphs/trunk/test/models/beautiful_fight_relationship.rb:20>],
37
+ :conflicts => [:dogs,
38
+ :kittens],
39
+ :as => :protector
40
+ # called from line 57
41
+
42
+ has_many :beautiful_fight_relationships_as_protector,
43
+ :extend => [Aquatic::FishEnemyPolymorphicJoinAssociationExtension0],
44
+ :dependent => :destroy,
45
+ :foreign_key => "protector_id",
46
+ :conditions => "protector_type = 'Aquatic::Fish'",
47
+ :as => :protector,
48
+ :class_name => "BeautifulFightRelationship"
49
+ # called from line 57
50
+
51
+ has_many :frogs,
52
+ :source => :enemy,
53
+ :extend => [Aquatic::FishFrogPolymorphicChildAssociationExtension, ExtensionModule, Aquatic::FishEnemyPolymorphicAssociationExtension0],
54
+ :limit => nil,
55
+ :through => :beautiful_fight_relationships_as_protector,
56
+ :group => nil,
57
+ :conditions => nil,
58
+ :source_type => "Frog",
59
+ :class_name => "Frog",
60
+ :order => nil
61
+ # called from line 57
62
+
63
+ has_many :kittens,
64
+ :source => :enemy,
65
+ :extend => [Aquatic::FishKittenPolymorphicChildAssociationExtension, ExtensionModule, Aquatic::FishEnemyPolymorphicAssociationExtension0],
66
+ :limit => nil,
67
+ :through => :beautiful_fight_relationships_as_protector,
68
+ :group => nil,
69
+ :conditions => nil,
70
+ :source_type => "Cat",
71
+ :class_name => "Kitten",
72
+ :order => nil
73
+ # called from line 57
74
+
75
+ has_many :dogs,
76
+ :source => :enemy,
77
+ :extend => [Aquatic::FishDogPolymorphicChildAssociationExtension, ExtensionModule, Aquatic::FishEnemyPolymorphicAssociationExtension0],
78
+ :limit => nil,
79
+ :through => :beautiful_fight_relationships_as_protector,
80
+ :group => nil,
81
+ :conditions => nil,
82
+ :source_type => "Dog",
83
+ :class_name => "Dog",
84
+ :order => nil
85
+ # called from line 57
86
+
87
+ has_many :eaters_foodstuffs,
88
+ :extend => [Petfood::PetfoodEaterPolymorphicJoinAssociationExtension0],
89
+ :dependent => :destroy,
90
+ :conditions => "NULL IS NULL OR NULL != 'Snausages'",
91
+ :as => :eater,
92
+ :class_name => "EatersFoodstuff",
93
+ :order => "NULL DESC"
94
+ # called from line 57
95
+
96
+ has_many :foodstuffs_of_eaters,
97
+ :source => :foodstuff,
98
+ :extend => [Petfood::PetfoodEaterPolymorphicParentAssociationExtension0],
99
+ :foreign_key => "foodstuff_id",
100
+ :limit => nil,
101
+ :through => :eaters_foodstuffs,
102
+ :group => nil,
103
+ :conditions => "petfoods.name IS NULL OR petfoods.name != 'Snausages'",
104
+ :offset => nil,
105
+ :class_name => "Petfood",
106
+ :order => "petfoods.the_petfood_primary_key DESC"
107
+ # called from line 57
108
+
109
+ end
@@ -0,0 +1,13 @@
1
+
2
+ class Aquatic::PupilsWhale
3
+
4
+ belongs_to :whale,
5
+ :foreign_key => "whale_id",
6
+ :class_name => "Aquatic::Whale"
7
+ # called from line 57
8
+
9
+ belongs_to :aquatic_pupil,
10
+ :polymorphic => true
11
+ # called from line 57
12
+
13
+ end
@@ -0,0 +1,42 @@
1
+
2
+ class Aquatic::Whale
3
+
4
+ has_many_polymorphs :aquatic_pupils,
5
+ :through => "aquatic/pupils_whales",
6
+ :from => [:dogs,
7
+ :"aquatic/fish"]
8
+ #<Proc:0x03c2588c@whale.rb:9>
9
+ # called from line 57
10
+
11
+ has_many :aquatic_pupils_whales,
12
+ :extend => [],
13
+ :dependent => :destroy,
14
+ :foreign_key => "whale_id",
15
+ :class_name => "Aquatic::PupilsWhale"
16
+ # called from line 57
17
+
18
+ has_many :aquatic_fish,
19
+ :source => :aquatic_pupil,
20
+ :extend => [Aquatic::WhaleAquaticFishPolymorphicChildAssociationExtension, Aquatic::WhaleAquaticPupilPolymorphicAssociationExtension0],
21
+ :limit => nil,
22
+ :through => :aquatic_pupils_whales,
23
+ :group => nil,
24
+ :conditions => nil,
25
+ :source_type => "Aquatic::Fish",
26
+ :class_name => "Aquatic::Fish",
27
+ :order => nil
28
+ # called from line 57
29
+
30
+ has_many :dogs,
31
+ :source => :aquatic_pupil,
32
+ :extend => [Aquatic::WhaleDogPolymorphicChildAssociationExtension, Aquatic::WhaleAquaticPupilPolymorphicAssociationExtension0],
33
+ :limit => nil,
34
+ :through => :aquatic_pupils_whales,
35
+ :group => nil,
36
+ :conditions => nil,
37
+ :source_type => "Dog",
38
+ :class_name => "Dog",
39
+ :order => nil
40
+ # called from line 57
41
+
42
+ end
@@ -0,0 +1,25 @@
1
+
2
+ class BeautifulFightRelationship
3
+
4
+ belongs_to :enemy,
5
+ :polymorphic => true
6
+ # called from line 57
7
+
8
+ belongs_to :protector,
9
+ :polymorphic => true
10
+ # called from line 57
11
+
12
+ acts_as_double_polymorphic_join ,
13
+ :enemies => [:dogs,
14
+ :kittens,
15
+ :frogs],
16
+ :join_extend => #<Proc:0x03be672c@/Users/eweaver/Desktop/projects/fauna/has_many_polymorphs/trunk/test/models/beautiful_fight_relationship.rb:20>,
17
+ :enemies_extend => [ExtensionModule, #<Proc:0x00000000@/Users/eweaver/Desktop/projects/fauna/has_many_polymorphs/trunk/test/models/beautiful_fight_relationship.rb:14>],
18
+ :protectors => [:wild_boars,
19
+ :kittens,
20
+ :"aquatic/fish",
21
+ :dogs],
22
+ :protectors_extend => #<Proc:0x03be68bc@/Users/eweaver/Desktop/projects/fauna/has_many_polymorphs/trunk/test/models/beautiful_fight_relationship.rb:15>
23
+ # called from line 57
24
+
25
+ end
@@ -0,0 +1,40 @@
1
+
2
+ class Citation
3
+
4
+ has_many_polymorphs :items,
5
+ :from => [:users,
6
+ :sellers]
7
+ # called from line 57
8
+
9
+ has_many :citations_items,
10
+ :extend => [],
11
+ :dependent => :destroy,
12
+ :foreign_key => "citation_id",
13
+ :class_name => "CitationsItem"
14
+ # called from line 57
15
+
16
+ has_many :sellers,
17
+ :source => :item,
18
+ :extend => [Citation::CitationSellerPolymorphicChildAssociationExtension],
19
+ :limit => nil,
20
+ :through => :citations_items,
21
+ :group => nil,
22
+ :conditions => nil,
23
+ :source_type => "Seller",
24
+ :class_name => "Seller",
25
+ :order => nil
26
+ # called from line 57
27
+
28
+ has_many :users,
29
+ :source => :item,
30
+ :extend => [Citation::CitationUserPolymorphicChildAssociationExtension],
31
+ :limit => nil,
32
+ :through => :citations_items,
33
+ :group => nil,
34
+ :conditions => nil,
35
+ :source_type => "User",
36
+ :class_name => "User",
37
+ :order => nil
38
+ # called from line 57
39
+
40
+ end
@@ -0,0 +1,12 @@
1
+
2
+ class CitationsItem
3
+
4
+ belongs_to ,
5
+ citatio
6
+ # called from line 57
7
+
8
+ belongs_to :item,
9
+ :polymorphic => true
10
+ # called from line 57
11
+
12
+ end
@@ -0,0 +1,183 @@
1
+
2
+ class Dog
3
+
4
+ has_many :aquatic_pupils_whales,
5
+ :extend => [],
6
+ :dependent => :destroy,
7
+ :conditions => nil,
8
+ :as => :aquatic_pupil,
9
+ :class_name => "Aquatic::PupilsWhale",
10
+ :order => nil
11
+ # called from line 57
12
+
13
+ has_many :whales,
14
+ :source => :whale,
15
+ :extend => [],
16
+ :foreign_key => "whale_id",
17
+ :limit => nil,
18
+ :through => :aquatic_pupils_whales,
19
+ :group => nil,
20
+ :conditions => nil,
21
+ :offset => nil,
22
+ :class_name => "Aquatic::Whale",
23
+ :order => nil
24
+ # called from line 57
25
+
26
+ has_many_polymorphs :enemies,
27
+ :singular_reverse_association_id => :protector,
28
+ :extend => [ExtensionModule, #<Proc:0x00000000@/Users/eweaver/Desktop/projects/fauna/has_many_polymorphs/trunk/test/models/beautiful_fight_relationship.rb:14>],
29
+ :foreign_key => "protector_id",
30
+ :is_double => true,
31
+ :from => [:dogs,
32
+ :kittens,
33
+ :frogs],
34
+ :through => :beautiful_fight_relationships,
35
+ :foreign_type_key => "protector_type",
36
+ :join_extend => [#<Proc:0x03be672c@/Users/eweaver/Desktop/projects/fauna/has_many_polymorphs/trunk/test/models/beautiful_fight_relationship.rb:20>],
37
+ :conflicts => [:dogs,
38
+ :kittens],
39
+ :as => :protector
40
+ # called from line 57
41
+
42
+ has_many :beautiful_fight_relationships_as_protector,
43
+ :extend => [Dog::DogEnemyPolymorphicJoinAssociationExtension0],
44
+ :dependent => :destroy,
45
+ :foreign_key => "protector_id",
46
+ :conditions => "protector_type = 'Dog'",
47
+ :as => :protector,
48
+ :class_name => "BeautifulFightRelationship"
49
+ # called from line 57
50
+
51
+ has_many :frogs,
52
+ :source => :enemy,
53
+ :extend => [Dog::DogFrogPolymorphicChildAssociationExtension, ExtensionModule, Dog::DogEnemyPolymorphicAssociationExtension0],
54
+ :limit => nil,
55
+ :through => :beautiful_fight_relationships_as_protector,
56
+ :group => nil,
57
+ :conditions => nil,
58
+ :source_type => "Frog",
59
+ :class_name => "Frog",
60
+ :order => nil
61
+ # called from line 57
62
+
63
+ has_many :enemy_kittens,
64
+ :source => :enemy,
65
+ :extend => [Dog::DogEnemyKittenPolymorphicChildAssociationExtension, ExtensionModule, Dog::DogEnemyPolymorphicAssociationExtension0],
66
+ :limit => nil,
67
+ :through => :beautiful_fight_relationships_as_protector,
68
+ :group => nil,
69
+ :conditions => nil,
70
+ :source_type => "Cat",
71
+ :class_name => "Kitten",
72
+ :order => nil
73
+ # called from line 57
74
+
75
+ has_many :enemy_dogs,
76
+ :source => :enemy,
77
+ :extend => [Dog::DogEnemyDogPolymorphicChildAssociationExtension, ExtensionModule, Dog::DogEnemyPolymorphicAssociationExtension0],
78
+ :limit => nil,
79
+ :through => :beautiful_fight_relationships_as_protector,
80
+ :group => nil,
81
+ :conditions => nil,
82
+ :source_type => "Dog",
83
+ :class_name => "Dog",
84
+ :order => nil
85
+ # called from line 57
86
+
87
+ has_many_polymorphs :protectors,
88
+ :singular_reverse_association_id => :enemy,
89
+ :extend => #<Proc:0x03be68bc@/Users/eweaver/Desktop/projects/fauna/has_many_polymorphs/trunk/test/models/beautiful_fight_relationship.rb:15>,
90
+ :foreign_key => "enemy_id",
91
+ :is_double => true,
92
+ :from => [:wild_boars,
93
+ :kittens,
94
+ :"aquatic/fish",
95
+ :dogs],
96
+ :through => :beautiful_fight_relationships,
97
+ :foreign_type_key => "enemy_type",
98
+ :join_extend => [#<Proc:0x03be672c@/Users/eweaver/Desktop/projects/fauna/has_many_polymorphs/trunk/test/models/beautiful_fight_relationship.rb:20>],
99
+ :conflicts => [:kittens,
100
+ :dogs],
101
+ :as => :enemy
102
+ # called from line 57
103
+
104
+ has_many :beautiful_fight_relationships_as_enemy,
105
+ :extend => [Dog::DogProtectorPolymorphicJoinAssociationExtension0],
106
+ :dependent => :destroy,
107
+ :foreign_key => "enemy_id",
108
+ :conditions => "enemy_type = 'Dog'",
109
+ :as => :enemy,
110
+ :class_name => "BeautifulFightRelationship"
111
+ # called from line 57
112
+
113
+ has_many :protector_kittens,
114
+ :source => :protector,
115
+ :extend => [Dog::DogProtectorKittenPolymorphicChildAssociationExtension, Dog::DogProtectorPolymorphicAssociationExtension0],
116
+ :limit => nil,
117
+ :through => :beautiful_fight_relationships_as_enemy,
118
+ :group => nil,
119
+ :conditions => nil,
120
+ :source_type => "Cat",
121
+ :class_name => "Kitten",
122
+ :order => nil
123
+ # called from line 57
124
+
125
+ has_many :aquatic_fish,
126
+ :source => :protector,
127
+ :extend => [Dog::DogAquaticFishPolymorphicChildAssociationExtension, Dog::DogProtectorPolymorphicAssociationExtension0],
128
+ :limit => nil,
129
+ :through => :beautiful_fight_relationships_as_enemy,
130
+ :group => nil,
131
+ :conditions => nil,
132
+ :source_type => "Aquatic::Fish",
133
+ :class_name => "Aquatic::Fish",
134
+ :order => nil
135
+ # called from line 57
136
+
137
+ has_many :wild_boars,
138
+ :source => :protector,
139
+ :extend => [Dog::DogWildBoarPolymorphicChildAssociationExtension, Dog::DogProtectorPolymorphicAssociationExtension0],
140
+ :limit => nil,
141
+ :through => :beautiful_fight_relationships_as_enemy,
142
+ :group => nil,
143
+ :conditions => nil,
144
+ :source_type => "WildBoar",
145
+ :class_name => "WildBoar",
146
+ :order => nil
147
+ # called from line 57
148
+
149
+ has_many :protector_dogs,
150
+ :source => :protector,
151
+ :extend => [Dog::DogProtectorDogPolymorphicChildAssociationExtension, Dog::DogProtectorPolymorphicAssociationExtension0],
152
+ :limit => nil,
153
+ :through => :beautiful_fight_relationships_as_enemy,
154
+ :group => nil,
155
+ :conditions => nil,
156
+ :source_type => "Dog",
157
+ :class_name => "Dog",
158
+ :order => nil
159
+ # called from line 57
160
+
161
+ has_many :eaters_foodstuffs,
162
+ :extend => [Petfood::PetfoodEaterPolymorphicJoinAssociationExtension0],
163
+ :dependent => :destroy,
164
+ :conditions => "NULL IS NULL OR NULL != 'Snausages'",
165
+ :as => :eater,
166
+ :class_name => "EatersFoodstuff",
167
+ :order => "NULL DESC"
168
+ # called from line 57
169
+
170
+ has_many :foodstuffs_of_eaters,
171
+ :source => :foodstuff,
172
+ :extend => [Petfood::PetfoodEaterPolymorphicParentAssociationExtension0],
173
+ :foreign_key => "foodstuff_id",
174
+ :limit => nil,
175
+ :through => :eaters_foodstuffs,
176
+ :group => nil,
177
+ :conditions => "petfoods.name IS NULL OR petfoods.name != 'Snausages'",
178
+ :offset => nil,
179
+ :class_name => "Petfood",
180
+ :order => "petfoods.the_petfood_primary_key DESC"
181
+ # called from line 57
182
+
183
+ end
@@ -0,0 +1,13 @@
1
+
2
+ class EatersFoodstuff
3
+
4
+ belongs_to :foodstuff,
5
+ :foreign_key => "foodstuff_id",
6
+ :class_name => "Petfood"
7
+ # called from line 57
8
+
9
+ belongs_to :eater,
10
+ :polymorphic => true
11
+ # called from line 57
12
+
13
+ end