Skip to content

Commit baaf8cf

Browse files
amatsudaarunagw
authored andcommitted
More unused associations in AR test models
1 parent e6a5209 commit baaf8cf

File tree

8 files changed

+0
-13
lines changed

8 files changed

+0
-13
lines changed

activerecord/test/models/car.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
class Car < ActiveRecord::Base
2-
32
has_many :bulbs
43
has_many :funky_bulbs, class_name: 'FunkyBulb', dependent: :destroy
54
has_many :foo_bulbs, -> { where(:name => 'foo') }, :class_name => "Bulb"
6-
has_many :frickinawesome_bulbs, -> { where :frickinawesome => true }, :class_name => "Bulb"
75

86
has_one :bulb
9-
has_one :frickinawesome_bulb, -> { where :frickinawesome => true }, :class_name => "Bulb"
107

118
has_many :tyres
129
has_many :engines, :dependent => :destroy

activerecord/test/models/citation.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
class Citation < ActiveRecord::Base
22
belongs_to :reference_of, :class_name => "Book", :foreign_key => :book2_id
3-
4-
belongs_to :book1, :class_name => "Book", :foreign_key => :book1_id
5-
belongs_to :book2, :class_name => "Book", :foreign_key => :book2_id
63
end

activerecord/test/models/club.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ class Club < ActiveRecord::Base
22
has_one :membership
33
has_many :memberships, :inverse_of => false
44
has_many :members, :through => :memberships
5-
has_many :current_memberships
65
has_one :sponsor
76
has_one :sponsored_member, :through => :sponsor, :source => :sponsorable, :source_type => "Member"
87
belongs_to :category

activerecord/test/models/company.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ class Firm < Company
4949
has_many :clients_like_ms, -> { where("name = 'Microsoft'").order("id") }, :class_name => "Client"
5050
has_many :clients_like_ms_with_hash_conditions, -> { where(:name => 'Microsoft').order("id") }, :class_name => "Client"
5151
has_many :plain_clients, :class_name => 'Client'
52-
has_many :readonly_clients, -> { readonly }, :class_name => 'Client'
5352
has_many :clients_using_primary_key, :class_name => 'Client',
5453
:primary_key => 'name', :foreign_key => 'firm_name'
5554
has_many :clients_using_primary_key_with_delete_all, :class_name => 'Client',
@@ -167,7 +166,6 @@ class ExclusivelyDependentFirm < Company
167166
has_one :account, :foreign_key => "firm_id", :dependent => :delete
168167
has_many :dependent_sanitized_conditional_clients_of_firm, -> { order("id").where("name = 'BigShot Inc.'") }, :foreign_key => "client_of", :class_name => "Client", :dependent => :delete_all
169168
has_many :dependent_conditional_clients_of_firm, -> { order("id").where("name = ?", 'BigShot Inc.') }, :foreign_key => "client_of", :class_name => "Client", :dependent => :delete_all
170-
has_many :dependent_hash_conditional_clients_of_firm, -> { order("id").where(:name => 'BigShot Inc.') }, :foreign_key => "client_of", :class_name => "Client", :dependent => :delete_all
171169
end
172170

173171
class SpecialClient < Client

activerecord/test/models/member.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ class Member < ActiveRecord::Base
22
has_one :current_membership
33
has_one :selected_membership
44
has_one :membership
5-
has_many :fellow_members, :through => :club, :source => :members
65
has_one :club, :through => :current_membership
76
has_one :selected_club, :through => :selected_membership, :source => :club
87
has_one :favourite_club, -> { where "memberships.favourite = ?", true }, :through => :membership, :source => :club

activerecord/test/models/post.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ def add_joins_and_select
130130
has_many :secure_readers
131131
has_many :readers_with_person, -> { includes(:person) }, :class_name => "Reader"
132132
has_many :people, :through => :readers
133-
has_many :secure_people, :through => :secure_readers
134133
has_many :single_people, :through => :readers
135134
has_many :people_with_callbacks, :source=>:person, :through => :readers,
136135
:before_add => lambda {|owner, reader| log(:added, :before, reader.first_name) },

activerecord/test/models/project.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
class Project < ActiveRecord::Base
22
has_and_belongs_to_many :developers, -> { distinct.order 'developers.name desc, developers.id desc' }
33
has_and_belongs_to_many :readonly_developers, -> { readonly }, :class_name => "Developer"
4-
has_and_belongs_to_many :selected_developers, -> { distinct.select "developers.*" }, :class_name => "Developer"
54
has_and_belongs_to_many :non_unique_developers, -> { order 'developers.name desc, developers.id desc' }, :class_name => 'Developer'
65
has_and_belongs_to_many :limited_developers, -> { limit 1 }, :class_name => "Developer"
76
has_and_belongs_to_many :developers_named_david, -> { where("name = 'David'").distinct }, :class_name => "Developer"

activerecord/test/models/topic.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ def two
3434

3535
has_many :replies, :dependent => :destroy, :foreign_key => "parent_id"
3636
has_many :approved_replies, -> { approved }, class_name: 'Reply', foreign_key: "parent_id", counter_cache: 'replies_count'
37-
has_many :replies_with_primary_key, :class_name => "Reply", :dependent => :destroy, :primary_key => "title", :foreign_key => "parent_title"
3837

3938
has_many :unique_replies, :dependent => :destroy, :foreign_key => "parent_id"
4039
has_many :silly_unique_replies, :dependent => :destroy, :foreign_key => "parent_id"

0 commit comments

Comments
 (0)