polyamorous 1.3.3 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +5 -5
  2. data/lib/polyamorous.rb +13 -40
  3. data/lib/polyamorous/activerecord_5.1_ruby_2/join_association.rb +1 -9
  4. data/lib/polyamorous/activerecord_5.1_ruby_2/join_dependency.rb +2 -20
  5. data/lib/polyamorous/{activerecord_5.2_ruby_2 → activerecord_5.2.0_ruby_2}/join_association.rb +2 -10
  6. data/lib/polyamorous/{activerecord_5.2_ruby_2 → activerecord_5.2.0_ruby_2}/join_dependency.rb +3 -21
  7. data/lib/polyamorous/activerecord_5.2.0_ruby_2/reflection.rb +12 -0
  8. data/lib/polyamorous/activerecord_5.2.1_ruby_2/join_association.rb +22 -0
  9. data/lib/polyamorous/activerecord_5.2.1_ruby_2/join_dependency.rb +81 -0
  10. data/lib/polyamorous/activerecord_5.2.1_ruby_2/reflection.rb +2 -0
  11. data/lib/polyamorous/activerecord_6.0_ruby_2/join_association.rb +2 -0
  12. data/lib/polyamorous/activerecord_6.0_ruby_2/join_dependency.rb +81 -0
  13. data/lib/polyamorous/activerecord_6.0_ruby_2/reflection.rb +2 -0
  14. data/lib/polyamorous/activerecord_6.1_ruby_2/join_association.rb +2 -0
  15. data/lib/polyamorous/activerecord_6.1_ruby_2/join_dependency.rb +2 -0
  16. data/lib/polyamorous/activerecord_6.1_ruby_2/reflection.rb +2 -0
  17. data/lib/polyamorous/version.rb +1 -1
  18. data/polyamorous.gemspec +2 -4
  19. metadata +19 -49
  20. data/.gitignore +0 -6
  21. data/.travis.yml +0 -59
  22. data/Gemfile +0 -33
  23. data/LICENSE +0 -20
  24. data/README.md +0 -21
  25. data/Rakefile +0 -17
  26. data/lib/polyamorous/activerecord_3_and_4.0_ruby_1.9/join_association.rb +0 -76
  27. data/lib/polyamorous/activerecord_3_and_4.0_ruby_1.9/join_dependency.rb +0 -96
  28. data/lib/polyamorous/activerecord_4.1_ruby_1.9/join_association.rb +0 -2
  29. data/lib/polyamorous/activerecord_4.1_ruby_1.9/join_dependency.rb +0 -4
  30. data/lib/polyamorous/activerecord_4.1_ruby_2/join_association.rb +0 -2
  31. data/lib/polyamorous/activerecord_4.1_ruby_2/join_dependency.rb +0 -3
  32. data/lib/polyamorous/activerecord_4.1_ruby_2/make_polyamorous_inner_joins.rb +0 -14
  33. data/lib/polyamorous/activerecord_4.2_ruby_1.9/join_association.rb +0 -46
  34. data/lib/polyamorous/activerecord_4.2_ruby_1.9/join_dependency.rb +0 -87
  35. data/lib/polyamorous/activerecord_4.2_ruby_2/join_association.rb +0 -2
  36. data/lib/polyamorous/activerecord_4.2_ruby_2/join_dependency.rb +0 -24
  37. data/spec/blueprints/articles.rb +0 -5
  38. data/spec/blueprints/comments.rb +0 -5
  39. data/spec/blueprints/notes.rb +0 -3
  40. data/spec/blueprints/people.rb +0 -4
  41. data/spec/blueprints/tags.rb +0 -3
  42. data/spec/helpers/polyamorous_helper.rb +0 -26
  43. data/spec/polyamorous/join_association_spec.rb +0 -54
  44. data/spec/polyamorous/join_dependency_spec.rb +0 -102
  45. data/spec/polyamorous/join_spec.rb +0 -19
  46. data/spec/spec_helper.rb +0 -43
  47. data/spec/support/schema.rb +0 -98
@@ -1,98 +0,0 @@
1
- require 'active_record'
2
-
3
- ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')
4
-
5
- class Person < ActiveRecord::Base
6
- belongs_to :parent, class_name: 'Person', foreign_key: :parent_id
7
- has_many :children, class_name: 'Person', foreign_key: :parent_id
8
- has_many :articles
9
- has_many :comments
10
- has_many :authored_article_comments, through: :articles,
11
- foreign_key: :person_id, source: :comments
12
- has_many :notes, as: :notable
13
- end
14
-
15
- class Article < ActiveRecord::Base
16
- belongs_to :person
17
- has_many :comments
18
- has_and_belongs_to_many :tags
19
- has_many :notes, as: :notable
20
- end
21
-
22
- class Comment < ActiveRecord::Base
23
- belongs_to :article
24
- belongs_to :person
25
- end
26
-
27
- class Tag < ActiveRecord::Base
28
- has_and_belongs_to_many :articles
29
- end
30
-
31
- class Note < ActiveRecord::Base
32
- belongs_to :notable, polymorphic: true
33
- end
34
-
35
- module Schema
36
- def self.create
37
- ActiveRecord::Migration.verbose = false
38
-
39
- ActiveRecord::Schema.define do
40
- create_table :people, force: true do |t|
41
- t.integer :parent_id
42
- t.string :name
43
- t.integer :salary
44
- t.boolean :awesome, default: false
45
- t.timestamps null: false
46
- end
47
-
48
- create_table :articles, force: true do |t|
49
- t.integer :person_id
50
- t.string :title
51
- t.text :body
52
- end
53
-
54
- create_table :comments, force: true do |t|
55
- t.integer :article_id
56
- t.integer :person_id
57
- t.text :body
58
- end
59
-
60
- create_table :tags, force: true do |t|
61
- t.string :name
62
- end
63
-
64
- create_table :articles_tags, force: true, id: false do |t|
65
- t.integer :article_id
66
- t.integer :tag_id
67
- end
68
-
69
- create_table :notes, force: true do |t|
70
- t.integer :notable_id
71
- t.string :notable_type
72
- t.string :note
73
- end
74
- end
75
-
76
- 10.times do
77
- person = Person.make
78
- Note.make(notable: person)
79
- 3.times do
80
- article = Article.make(person: person)
81
- 3.times do
82
- article.tags = [Tag.make, Tag.make, Tag.make]
83
- end
84
- Note.make(notable: article)
85
- 10.times do
86
- Comment.make(article: article)
87
- end
88
- end
89
- 2.times do
90
- Comment.make(person: person)
91
- end
92
- end
93
-
94
- Comment.make(
95
- body: 'First post!', article: Article.make(title: 'Hello, world!')
96
- )
97
- end
98
- end