inverse_of 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +8 -0
- data/LICENSE +1 -1
- data/Rakefile +1 -38
- data/lib/inverse_of.rb +220 -221
- data/lib/inverse_of/version.rb +11 -0
- metadata +88 -69
- data/.document +0 -5
- data/.gitignore +0 -21
- data/MIT-LICENSE +0 -20
- data/VERSION +0 -1
- data/install.rb +0 -1
- data/inverse_of.gemspec +0 -76
- data/rails/init.rb +0 -1
- data/tasks/inverse_of_tasks.rake +0 -4
- data/test/cases/helper.rb +0 -28
- data/test/cases/inverse_associations_test.rb +0 -567
- data/test/fixtures/clubs.yml +0 -6
- data/test/fixtures/faces.yml +0 -11
- data/test/fixtures/interests.yml +0 -33
- data/test/fixtures/men.yml +0 -5
- data/test/fixtures/sponsors.yml +0 -9
- data/test/fixtures/zines.yml +0 -5
- data/test/models/club.rb +0 -13
- data/test/models/face.rb +0 -7
- data/test/models/interest.rb +0 -5
- data/test/models/man.rb +0 -9
- data/test/models/sponsor.rb +0 -4
- data/test/models/zine.rb +0 -3
- data/test/schema/schema.rb +0 -32
- data/uninstall.rb +0 -1
data/test/fixtures/clubs.yml
DELETED
data/test/fixtures/faces.yml
DELETED
data/test/fixtures/interests.yml
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
trainspotting:
|
2
|
-
topic: Trainspotting
|
3
|
-
zine: staying_in
|
4
|
-
man: gordon
|
5
|
-
|
6
|
-
birdwatching:
|
7
|
-
topic: Birdwatching
|
8
|
-
zine: staying_in
|
9
|
-
man: gordon
|
10
|
-
|
11
|
-
stamp_collecting:
|
12
|
-
topic: Stamp Collecting
|
13
|
-
zine: staying_in
|
14
|
-
man: gordon
|
15
|
-
|
16
|
-
hunting:
|
17
|
-
topic: Hunting
|
18
|
-
zine: going_out
|
19
|
-
man: steve
|
20
|
-
|
21
|
-
woodsmanship:
|
22
|
-
topic: Woodsmanship
|
23
|
-
zine: going_out
|
24
|
-
man: steve
|
25
|
-
|
26
|
-
survival:
|
27
|
-
topic: Survival
|
28
|
-
zine: going_out
|
29
|
-
man: steve
|
30
|
-
|
31
|
-
llama_wrangling:
|
32
|
-
topic: Llama Wrangling
|
33
|
-
polymorphic_man: gordon (Man)
|
data/test/fixtures/men.yml
DELETED
data/test/fixtures/sponsors.yml
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
moustache_club_sponsor_for_groucho:
|
2
|
-
sponsor_club: moustache_club
|
3
|
-
sponsorable: groucho (Member)
|
4
|
-
boring_club_sponsor_for_groucho:
|
5
|
-
sponsor_club: boring_club
|
6
|
-
sponsorable: some_other_guy (Member)
|
7
|
-
crazy_club_sponsor_for_groucho:
|
8
|
-
sponsor_club: crazy_club
|
9
|
-
sponsorable: some_other_guy (Member)
|
data/test/fixtures/zines.yml
DELETED
data/test/models/club.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
class Club < ActiveRecord::Base
|
2
|
-
has_many :memberships
|
3
|
-
has_many :members, :through => :memberships
|
4
|
-
has_many :current_memberships
|
5
|
-
has_one :sponsor
|
6
|
-
has_one :sponsored_member, :through => :sponsor, :source => :sponsorable, :source_type => "Member"
|
7
|
-
|
8
|
-
private
|
9
|
-
|
10
|
-
def private_method
|
11
|
-
"I'm sorry sir, this is a *private* club, not a *pirate* club"
|
12
|
-
end
|
13
|
-
end
|
data/test/models/face.rb
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
class Face < ActiveRecord::Base
|
2
|
-
belongs_to :man, :inverse_of => :face
|
3
|
-
belongs_to :polymorphic_man, :polymorphic => true, :inverse_of => :polymorphic_face
|
4
|
-
# These is a "broken" inverse_of for the purposes of testing
|
5
|
-
belongs_to :horrible_man, :class_name => 'Man', :inverse_of => :horrible_face
|
6
|
-
belongs_to :horrible_polymorphic_man, :polymorphic => true, :inverse_of => :horrible_polymorphic_face
|
7
|
-
end
|
data/test/models/interest.rb
DELETED
data/test/models/man.rb
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
class Man < ActiveRecord::Base
|
2
|
-
has_one :face, :inverse_of => :man
|
3
|
-
has_one :polymorphic_face, :class_name => 'Face', :as => :polymorphic_man, :inverse_of => :polymorphic_man
|
4
|
-
has_many :interests, :inverse_of => :man
|
5
|
-
has_many :polymorphic_interests, :class_name => 'Interest', :as => :polymorphic_man, :inverse_of => :polymorphic_man
|
6
|
-
# These are "broken" inverse_of associations for the purposes of testing
|
7
|
-
has_one :dirty_face, :class_name => 'Face', :inverse_of => :dirty_man
|
8
|
-
has_many :secret_interests, :class_name => 'Interest', :inverse_of => :secret_man
|
9
|
-
end
|
data/test/models/sponsor.rb
DELETED
data/test/models/zine.rb
DELETED
data/test/schema/schema.rb
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
create_table :clubs, :force => true do |t|
|
2
|
-
t.string :name
|
3
|
-
end
|
4
|
-
|
5
|
-
create_table :sponsors, :force => true do |t|
|
6
|
-
t.integer :club_id
|
7
|
-
t.integer :sponsorable_id
|
8
|
-
t.string :sponsorable_type
|
9
|
-
end
|
10
|
-
|
11
|
-
create_table :men, :force => true do |t|
|
12
|
-
t.string :name
|
13
|
-
end
|
14
|
-
|
15
|
-
create_table :faces, :force => true do |t|
|
16
|
-
t.string :description
|
17
|
-
t.integer :man_id
|
18
|
-
t.integer :polymorphic_man_id
|
19
|
-
t.string :polymorphic_man_type
|
20
|
-
end
|
21
|
-
|
22
|
-
create_table :interests, :force => true do |t|
|
23
|
-
t.string :topic
|
24
|
-
t.integer :man_id
|
25
|
-
t.integer :polymorphic_man_id
|
26
|
-
t.string :polymorphic_man_type
|
27
|
-
t.integer :zine_id
|
28
|
-
end
|
29
|
-
|
30
|
-
create_table :zines, :force => true do |t|
|
31
|
-
t.string :title
|
32
|
-
end
|
data/uninstall.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
# Uninstall hook code here
|