store_base_sti_class 1.1.0 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Appraisals +9 -55
- data/LICENSE.txt +1 -1
- data/README.md +37 -10
- data/gemfiles/rails_5.0.7.gemfile +8 -0
- data/gemfiles/rails_5.1.7.gemfile +8 -0
- data/gemfiles/rails_5.2.3.gemfile +8 -0
- data/gemfiles/rails_5.2.4.gemfile +8 -0
- data/gemfiles/rails_5.2.5.gemfile +8 -0
- data/gemfiles/rails_6.0.3.gemfile +8 -0
- data/gemfiles/rails_6.1.0.gemfile +8 -0
- data/lib/store_base_sti_class.rb +7 -7
- data/lib/store_base_sti_class/version.rb +1 -1
- data/lib/store_base_sti_class_for_5_0.rb +16 -0
- data/lib/store_base_sti_class_for_5_1.rb +16 -0
- data/lib/store_base_sti_class_for_5_2.rb +176 -0
- data/lib/store_base_sti_class_for_6_0.rb +153 -0
- data/lib/store_base_sti_class_for_6_1.rb +156 -0
- data/store_base_sti_class.gemspec +1 -2
- metadata +17 -176
- data/Gemfile.lock +0 -47
- data/debug.log +0 -53835
- data/gemfiles/rails_3.0.10.gemfile.lock +0 -45
- data/gemfiles/rails_3.0.11.gemfile.lock +0 -45
- data/gemfiles/rails_3.0.12.gemfile.lock +0 -45
- data/gemfiles/rails_3.0.13.gemfile.lock +0 -45
- data/gemfiles/rails_3.0.14.gemfile.lock +0 -45
- data/gemfiles/rails_3.0.15.gemfile.lock +0 -45
- data/gemfiles/rails_3.0.16.gemfile.lock +0 -45
- data/gemfiles/rails_3.0.17.gemfile.lock +0 -45
- data/gemfiles/rails_3.0.18.gemfile.lock +0 -45
- data/gemfiles/rails_3.0.19.gemfile.lock +0 -45
- data/gemfiles/rails_3.0.20.gemfile.lock +0 -45
- data/gemfiles/rails_3.0.5.gemfile.lock +0 -45
- data/gemfiles/rails_3.0.6.gemfile.lock +0 -45
- data/gemfiles/rails_3.0.7.gemfile.lock +0 -45
- data/gemfiles/rails_3.0.8.gemfile.lock +0 -45
- data/gemfiles/rails_3.0.9.gemfile.lock +0 -45
- data/gemfiles/rails_3.1.0.gemfile.lock +0 -49
- data/gemfiles/rails_3.1.10.gemfile.lock +0 -47
- data/gemfiles/rails_3.1.11.gemfile.lock +0 -47
- data/gemfiles/rails_3.1.12.gemfile.lock +0 -47
- data/gemfiles/rails_3.1.2.gemfile.lock +0 -47
- data/gemfiles/rails_3.1.3.gemfile.lock +0 -47
- data/gemfiles/rails_3.1.4.gemfile.lock +0 -47
- data/gemfiles/rails_3.1.5.gemfile.lock +0 -47
- data/gemfiles/rails_3.1.6.gemfile.lock +0 -47
- data/gemfiles/rails_3.1.7.gemfile.lock +0 -47
- data/gemfiles/rails_3.1.8.gemfile.lock +0 -47
- data/gemfiles/rails_3.1.9.gemfile.lock +0 -47
- data/gemfiles/rails_3.2.0.gemfile.lock +0 -47
- data/gemfiles/rails_3.2.1.gemfile.lock +0 -47
- data/gemfiles/rails_3.2.10.gemfile.lock +0 -47
- data/gemfiles/rails_3.2.11.gemfile.lock +0 -47
- data/gemfiles/rails_3.2.12.gemfile.lock +0 -47
- data/gemfiles/rails_3.2.13.gemfile.lock +0 -47
- data/gemfiles/rails_3.2.14.gemfile.lock +0 -44
- data/gemfiles/rails_3.2.15.gemfile.lock +0 -47
- data/gemfiles/rails_3.2.16.gemfile.lock +0 -47
- data/gemfiles/rails_3.2.17.gemfile.lock +0 -47
- data/gemfiles/rails_3.2.18.gemfile.lock +0 -47
- data/gemfiles/rails_3.2.19.gemfile.lock +0 -47
- data/gemfiles/rails_3.2.2.gemfile.lock +0 -47
- data/gemfiles/rails_3.2.20.gemfile.lock +0 -47
- data/gemfiles/rails_3.2.21.gemfile.lock +0 -47
- data/gemfiles/rails_3.2.22.gemfile.lock +0 -47
- data/gemfiles/rails_3.2.3.gemfile.lock +0 -47
- data/gemfiles/rails_3.2.4.gemfile.lock +0 -47
- data/gemfiles/rails_3.2.5.gemfile.lock +0 -47
- data/gemfiles/rails_3.2.6.gemfile.lock +0 -47
- data/gemfiles/rails_3.2.7.gemfile.lock +0 -47
- data/gemfiles/rails_3.2.8.gemfile.lock +0 -47
- data/gemfiles/rails_3.2.9.gemfile.lock +0 -47
- data/gemfiles/rails_4.0.0.gemfile +0 -7
- data/gemfiles/rails_4.0.0.gemfile.lock +0 -49
- data/gemfiles/rails_4.0.1.gemfile +0 -7
- data/gemfiles/rails_4.0.1.gemfile.lock +0 -49
- data/gemfiles/rails_4.0.10.gemfile +0 -7
- data/gemfiles/rails_4.0.10.gemfile.lock +0 -49
- data/gemfiles/rails_4.0.11.1.gemfile +0 -7
- data/gemfiles/rails_4.0.11.1.gemfile.lock +0 -49
- data/gemfiles/rails_4.0.11.gemfile +0 -7
- data/gemfiles/rails_4.0.11.gemfile.lock +0 -49
- data/gemfiles/rails_4.0.12.gemfile +0 -7
- data/gemfiles/rails_4.0.12.gemfile.lock +0 -49
- data/gemfiles/rails_4.0.13.gemfile +0 -7
- data/gemfiles/rails_4.0.13.gemfile.lock +0 -49
- data/gemfiles/rails_4.0.2.gemfile +0 -7
- data/gemfiles/rails_4.0.2.gemfile.lock +0 -49
- data/gemfiles/rails_4.0.3.gemfile +0 -7
- data/gemfiles/rails_4.0.3.gemfile.lock +0 -49
- data/gemfiles/rails_4.0.4.gemfile +0 -7
- data/gemfiles/rails_4.0.4.gemfile.lock +0 -49
- data/gemfiles/rails_4.0.5.gemfile +0 -7
- data/gemfiles/rails_4.0.5.gemfile.lock +0 -49
- data/gemfiles/rails_4.0.6.gemfile +0 -7
- data/gemfiles/rails_4.0.6.gemfile.lock +0 -49
- data/gemfiles/rails_4.0.7.gemfile +0 -7
- data/gemfiles/rails_4.0.7.gemfile.lock +0 -49
- data/gemfiles/rails_4.0.8.gemfile +0 -7
- data/gemfiles/rails_4.0.8.gemfile.lock +0 -49
- data/gemfiles/rails_4.0.9.gemfile +0 -7
- data/gemfiles/rails_4.0.9.gemfile.lock +0 -49
- data/gemfiles/rails_4.1.0.gemfile +0 -7
- data/gemfiles/rails_4.1.0.gemfile.lock +0 -48
- data/gemfiles/rails_4.1.1.gemfile +0 -7
- data/gemfiles/rails_4.1.1.gemfile.lock +0 -48
- data/gemfiles/rails_4.1.10.gemfile +0 -7
- data/gemfiles/rails_4.1.10.gemfile.lock +0 -48
- data/gemfiles/rails_4.1.11.gemfile +0 -7
- data/gemfiles/rails_4.1.11.gemfile.lock +0 -48
- data/gemfiles/rails_4.1.12.gemfile +0 -7
- data/gemfiles/rails_4.1.12.gemfile.lock +0 -48
- data/gemfiles/rails_4.1.13.gemfile +0 -7
- data/gemfiles/rails_4.1.13.gemfile.lock +0 -48
- data/gemfiles/rails_4.1.14.1.gemfile +0 -7
- data/gemfiles/rails_4.1.14.1.gemfile.lock +0 -48
- data/gemfiles/rails_4.1.14.2.gemfile +0 -7
- data/gemfiles/rails_4.1.14.2.gemfile.lock +0 -48
- data/gemfiles/rails_4.1.14.gemfile +0 -7
- data/gemfiles/rails_4.1.14.gemfile.lock +0 -48
- data/gemfiles/rails_4.1.15.gemfile +0 -7
- data/gemfiles/rails_4.1.15.gemfile.lock +0 -48
- data/gemfiles/rails_4.1.2.gemfile +0 -7
- data/gemfiles/rails_4.1.2.gemfile.lock +0 -48
- data/gemfiles/rails_4.1.3.gemfile +0 -7
- data/gemfiles/rails_4.1.3.gemfile.lock +0 -48
- data/gemfiles/rails_4.1.4.gemfile +0 -7
- data/gemfiles/rails_4.1.4.gemfile.lock +0 -48
- data/gemfiles/rails_4.1.5.gemfile +0 -7
- data/gemfiles/rails_4.1.5.gemfile.lock +0 -48
- data/gemfiles/rails_4.1.6.gemfile +0 -7
- data/gemfiles/rails_4.1.6.gemfile.lock +0 -48
- data/gemfiles/rails_4.1.7.1.gemfile +0 -7
- data/gemfiles/rails_4.1.7.1.gemfile.lock +0 -48
- data/gemfiles/rails_4.1.7.gemfile +0 -7
- data/gemfiles/rails_4.1.7.gemfile.lock +0 -48
- data/gemfiles/rails_4.1.8.gemfile +0 -7
- data/gemfiles/rails_4.1.8.gemfile.lock +0 -48
- data/gemfiles/rails_4.1.9.gemfile +0 -7
- data/gemfiles/rails_4.1.9.gemfile.lock +0 -48
- data/gemfiles/rails_4.2.0.gemfile +0 -7
- data/gemfiles/rails_4.2.0.gemfile.lock +0 -48
- data/gemfiles/rails_4.2.1.gemfile +0 -7
- data/gemfiles/rails_4.2.1.gemfile.lock +0 -48
- data/gemfiles/rails_4.2.2.gemfile +0 -7
- data/gemfiles/rails_4.2.2.gemfile.lock +0 -48
- data/gemfiles/rails_4.2.3.gemfile +0 -7
- data/gemfiles/rails_4.2.3.gemfile.lock +0 -48
- data/gemfiles/rails_4.2.4.gemfile +0 -7
- data/gemfiles/rails_4.2.4.gemfile.lock +0 -48
- data/gemfiles/rails_4.2.5.1.gemfile +0 -7
- data/gemfiles/rails_4.2.5.1.gemfile.lock +0 -48
- data/gemfiles/rails_4.2.5.2.gemfile +0 -7
- data/gemfiles/rails_4.2.5.2.gemfile.lock +0 -48
- data/gemfiles/rails_4.2.5.gemfile +0 -7
- data/gemfiles/rails_4.2.5.gemfile.lock +0 -48
- data/gemfiles/rails_4.2.6.gemfile +0 -7
- data/gemfiles/rails_4.2.6.gemfile.lock +0 -48
- data/gemfiles/rails_4.2.7.1.gemfile +0 -7
- data/gemfiles/rails_4.2.7.gemfile +0 -7
- data/gemfiles/rails_4.2.8.gemfile +0 -7
- data/gemfiles/rails_5.0.0.1.gemfile +0 -7
- data/gemfiles/rails_5.0.0.gemfile +0 -7
- data/gemfiles/rails_5.0.1.gemfile +0 -7
- data/gemfiles/rails_5.0.1.gemfile.lock +0 -48
- data/gemfiles/rails_5.0.2.gemfile +0 -7
- data/gemfiles/rails_5.0.3.gemfile +0 -7
- data/gemfiles/rails_5.1.0.gemfile +0 -7
- data/gemfiles/rails_5.1.1.gemfile +0 -7
- data/lib/store_base_sti_class_for_4_0.rb +0 -337
- data/lib/store_base_sti_class_for_4_1.rb +0 -360
- data/lib/store_base_sti_class_for_4_2.rb +0 -360
- data/storebasestiname_unittest.sql +0 -0
@@ -0,0 +1,153 @@
|
|
1
|
+
require 'active_record/associations/join_dependency/join_part'
|
2
|
+
|
3
|
+
if ActiveRecord::VERSION::STRING =~ /^6\.0/
|
4
|
+
module ActiveRecord
|
5
|
+
|
6
|
+
class Base
|
7
|
+
class_attribute :store_base_sti_class
|
8
|
+
self.store_base_sti_class = true
|
9
|
+
end
|
10
|
+
|
11
|
+
module Inheritance
|
12
|
+
module ClassMethods
|
13
|
+
def polymorphic_name
|
14
|
+
ActiveRecord::Base.store_base_sti_class ? base_class.name : name
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
module Associations
|
20
|
+
class Preloader
|
21
|
+
class ThroughAssociation < Association
|
22
|
+
private
|
23
|
+
|
24
|
+
def through_scope
|
25
|
+
scope = through_reflection.klass.unscoped
|
26
|
+
options = reflection.options
|
27
|
+
|
28
|
+
if options[:source_type]
|
29
|
+
|
30
|
+
# BEGIN PATCH
|
31
|
+
# original:
|
32
|
+
# scope.where! reflection.foreign_type => options[:source_type]
|
33
|
+
|
34
|
+
adjusted_foreign_type =
|
35
|
+
if ActiveRecord::Base.store_base_sti_class
|
36
|
+
options[:source_type]
|
37
|
+
else
|
38
|
+
([options[:source_type].constantize] + options[:source_type].constantize.descendants).map(&:to_s)
|
39
|
+
end
|
40
|
+
|
41
|
+
scope.where! reflection.foreign_type => adjusted_foreign_type
|
42
|
+
# END PATCH
|
43
|
+
|
44
|
+
elsif !reflection_scope.where_clause.empty?
|
45
|
+
scope.where_clause = reflection_scope.where_clause
|
46
|
+
values = reflection_scope.values
|
47
|
+
|
48
|
+
if includes = values[:includes]
|
49
|
+
scope.includes!(source_reflection.name => includes)
|
50
|
+
else
|
51
|
+
scope.includes!(source_reflection.name)
|
52
|
+
end
|
53
|
+
|
54
|
+
if values[:references] && !values[:references].empty?
|
55
|
+
scope.references!(values[:references])
|
56
|
+
else
|
57
|
+
scope.references!(source_reflection.table_name)
|
58
|
+
end
|
59
|
+
|
60
|
+
if joins = values[:joins]
|
61
|
+
scope.joins!(source_reflection.name => joins)
|
62
|
+
end
|
63
|
+
|
64
|
+
if left_outer_joins = values[:left_outer_joins]
|
65
|
+
scope.left_outer_joins!(source_reflection.name => left_outer_joins)
|
66
|
+
end
|
67
|
+
|
68
|
+
if scope.eager_loading? && order_values = values[:order]
|
69
|
+
scope = scope.order(order_values)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
scope unless scope.empty_scope?
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
class AssociationScope
|
79
|
+
private
|
80
|
+
|
81
|
+
def next_chain_scope(scope, reflection, next_reflection)
|
82
|
+
join_keys = reflection.join_keys
|
83
|
+
key = join_keys.key
|
84
|
+
foreign_key = join_keys.foreign_key
|
85
|
+
|
86
|
+
table = reflection.aliased_table
|
87
|
+
foreign_table = next_reflection.aliased_table
|
88
|
+
constraint = table[key].eq(foreign_table[foreign_key])
|
89
|
+
|
90
|
+
if reflection.type
|
91
|
+
# BEGIN PATCH
|
92
|
+
# original:
|
93
|
+
# value = transform_value(next_reflection.klass.polymorphic_name)
|
94
|
+
# scope = apply_scope(scope, table, reflection.type, value)
|
95
|
+
if ActiveRecord::Base.store_base_sti_class
|
96
|
+
value = transform_value(next_reflection.klass.polymorphic_name)
|
97
|
+
else
|
98
|
+
klass = next_reflection.klass
|
99
|
+
value = ([klass] + klass.descendants).map(&:name)
|
100
|
+
end
|
101
|
+
scope = apply_scope(scope, table, reflection.type, value)
|
102
|
+
# END PATCH
|
103
|
+
end
|
104
|
+
|
105
|
+
scope.joins!(join(foreign_table, constraint))
|
106
|
+
end
|
107
|
+
|
108
|
+
end
|
109
|
+
|
110
|
+
class HasManyThroughAssociation
|
111
|
+
private
|
112
|
+
|
113
|
+
def build_through_record(record)
|
114
|
+
@through_records[record.object_id] ||= begin
|
115
|
+
ensure_mutable
|
116
|
+
|
117
|
+
attributes = through_scope_attributes
|
118
|
+
attributes[source_reflection.name] = record
|
119
|
+
|
120
|
+
# START PATCH
|
121
|
+
if ActiveRecord::Base.store_base_sti_class
|
122
|
+
attributes[source_reflection.foreign_type] = options[:source_type] if options[:source_type]
|
123
|
+
end
|
124
|
+
# END PATCH
|
125
|
+
|
126
|
+
through_association.build(attributes)
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
module Reflection
|
133
|
+
class PolymorphicReflection
|
134
|
+
def source_type_scope
|
135
|
+
type = @previous_reflection.foreign_type
|
136
|
+
source_type = @previous_reflection.options[:source_type]
|
137
|
+
|
138
|
+
# START PATCH
|
139
|
+
adjusted_source_type =
|
140
|
+
if ActiveRecord::Base.store_base_sti_class
|
141
|
+
source_type
|
142
|
+
else
|
143
|
+
([source_type.constantize] + source_type.constantize.descendants).map(&:to_s)
|
144
|
+
end
|
145
|
+
# END PATCH
|
146
|
+
|
147
|
+
lambda { |object| where(type => adjusted_source_type) }
|
148
|
+
end
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
end
|
@@ -0,0 +1,156 @@
|
|
1
|
+
require 'active_record/associations/join_dependency/join_part'
|
2
|
+
|
3
|
+
if ActiveRecord::VERSION::STRING =~ /^6\.1/
|
4
|
+
module ActiveRecord
|
5
|
+
|
6
|
+
class Base
|
7
|
+
class_attribute :store_base_sti_class
|
8
|
+
self.store_base_sti_class = true
|
9
|
+
end
|
10
|
+
|
11
|
+
module Inheritance
|
12
|
+
module ClassMethods
|
13
|
+
def polymorphic_name
|
14
|
+
ActiveRecord::Base.store_base_sti_class ? base_class.name : name
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
module Associations
|
20
|
+
class Preloader
|
21
|
+
class ThroughAssociation < Association
|
22
|
+
private
|
23
|
+
|
24
|
+
def through_scope
|
25
|
+
scope = through_reflection.klass.unscoped
|
26
|
+
options = reflection.options
|
27
|
+
|
28
|
+
values = reflection_scope.values
|
29
|
+
if annotations = values[:annotate]
|
30
|
+
scope.annotate!(*annotations)
|
31
|
+
end
|
32
|
+
|
33
|
+
if options[:source_type]
|
34
|
+
# BEGIN PATCH
|
35
|
+
# original:
|
36
|
+
# scope.where! reflection.foreign_type => options[:source_type]
|
37
|
+
|
38
|
+
adjusted_foreign_type =
|
39
|
+
if ActiveRecord::Base.store_base_sti_class
|
40
|
+
options[:source_type]
|
41
|
+
else
|
42
|
+
([options[:source_type].constantize] + options[:source_type].constantize.descendants).map(&:to_s)
|
43
|
+
end
|
44
|
+
|
45
|
+
scope.where! reflection.foreign_type => adjusted_foreign_type
|
46
|
+
# END PATCH
|
47
|
+
|
48
|
+
elsif !reflection_scope.where_clause.empty?
|
49
|
+
scope.where_clause = reflection_scope.where_clause
|
50
|
+
|
51
|
+
if includes = values[:includes]
|
52
|
+
scope.includes!(source_reflection.name => includes)
|
53
|
+
else
|
54
|
+
scope.includes!(source_reflection.name)
|
55
|
+
end
|
56
|
+
|
57
|
+
if values[:references] && !values[:references].empty?
|
58
|
+
scope.references_values |= values[:references]
|
59
|
+
else
|
60
|
+
scope.references!(source_reflection.table_name)
|
61
|
+
end
|
62
|
+
|
63
|
+
if joins = values[:joins]
|
64
|
+
scope.joins!(source_reflection.name => joins)
|
65
|
+
end
|
66
|
+
|
67
|
+
if left_outer_joins = values[:left_outer_joins]
|
68
|
+
scope.left_outer_joins!(source_reflection.name => left_outer_joins)
|
69
|
+
end
|
70
|
+
|
71
|
+
if scope.eager_loading? && order_values = values[:order]
|
72
|
+
scope = scope.order(order_values)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
scope
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
class AssociationScope
|
82
|
+
private
|
83
|
+
|
84
|
+
def next_chain_scope(scope, reflection, next_reflection)
|
85
|
+
primary_key = reflection.join_primary_key
|
86
|
+
foreign_key = reflection.join_foreign_key
|
87
|
+
|
88
|
+
table = reflection.aliased_table
|
89
|
+
foreign_table = next_reflection.aliased_table
|
90
|
+
constraint = table[primary_key].eq(foreign_table[foreign_key])
|
91
|
+
|
92
|
+
if reflection.type
|
93
|
+
# BEGIN PATCH
|
94
|
+
# original:
|
95
|
+
# value = transform_value(next_reflection.klass.polymorphic_name)
|
96
|
+
# scope = apply_scope(scope, table, reflection.type, value)
|
97
|
+
|
98
|
+
if ActiveRecord::Base.store_base_sti_class
|
99
|
+
value = transform_value(next_reflection.klass.polymorphic_name)
|
100
|
+
else
|
101
|
+
klass = next_reflection.klass
|
102
|
+
value = ([klass] + klass.descendants).map(&:name)
|
103
|
+
end
|
104
|
+
scope = apply_scope(scope, table, reflection.type, value)
|
105
|
+
# END PATCH
|
106
|
+
end
|
107
|
+
|
108
|
+
scope.joins!(join(foreign_table, constraint))
|
109
|
+
end
|
110
|
+
|
111
|
+
end
|
112
|
+
|
113
|
+
class HasManyThroughAssociation
|
114
|
+
private
|
115
|
+
|
116
|
+
def build_through_record(record)
|
117
|
+
@through_records[record.object_id] ||= begin
|
118
|
+
ensure_mutable
|
119
|
+
|
120
|
+
attributes = through_scope_attributes
|
121
|
+
attributes[source_reflection.name] = record
|
122
|
+
|
123
|
+
# START PATCH
|
124
|
+
if ActiveRecord::Base.store_base_sti_class
|
125
|
+
attributes[source_reflection.foreign_type] = options[:source_type] if options[:source_type]
|
126
|
+
end
|
127
|
+
# END PATCH
|
128
|
+
|
129
|
+
through_association.build(attributes)
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
module Reflection
|
136
|
+
class PolymorphicReflection
|
137
|
+
def source_type_scope
|
138
|
+
type = @previous_reflection.foreign_type
|
139
|
+
source_type = @previous_reflection.options[:source_type]
|
140
|
+
|
141
|
+
# START PATCH
|
142
|
+
adjusted_source_type =
|
143
|
+
if ActiveRecord::Base.store_base_sti_class
|
144
|
+
source_type
|
145
|
+
else
|
146
|
+
([source_type.constantize] + source_type.constantize.descendants).map(&:to_s)
|
147
|
+
end
|
148
|
+
# END PATCH
|
149
|
+
|
150
|
+
lambda { |object| where(type => adjusted_source_type) }
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
end
|
@@ -20,11 +20,10 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.homepage = 'http://github.com/appfolio/store_base_sti_class'
|
21
21
|
s.licenses = ['MIT']
|
22
22
|
s.rubygems_version = '2.2.2'
|
23
|
-
s.summary = 'Modifies ActiveRecord 4.
|
23
|
+
s.summary = 'Modifies ActiveRecord 4.2.x - 6.0.x with the ability to store the actual class (instead of the base class) in polymorhic _type columns when using STI'
|
24
24
|
|
25
25
|
s.add_runtime_dependency(%q<activerecord>, ['>= 4.0'])
|
26
26
|
s.add_development_dependency(%q<minitest>, ['>= 4.0'])
|
27
|
-
s.add_development_dependency(%q<sqlite3>, ['>= 0'])
|
28
27
|
s.add_development_dependency(%q<appraisal>, ['>= 0'])
|
29
28
|
s.add_development_dependency(%q<bundler>, ['>= 0'])
|
30
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: store_base_sti_class
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AppFolio
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -38,20 +38,6 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '4.0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: sqlite3
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: appraisal
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,173 +80,29 @@ extra_rdoc_files:
|
|
94
80
|
files:
|
95
81
|
- Appraisals
|
96
82
|
- Gemfile
|
97
|
-
- Gemfile.lock
|
98
83
|
- LICENSE.txt
|
99
84
|
- README.md
|
100
85
|
- Rakefile
|
101
|
-
-
|
102
|
-
- gemfiles/
|
103
|
-
- gemfiles/
|
104
|
-
- gemfiles/
|
105
|
-
- gemfiles/
|
106
|
-
- gemfiles/
|
107
|
-
- gemfiles/
|
108
|
-
- gemfiles/rails_3.0.16.gemfile.lock
|
109
|
-
- gemfiles/rails_3.0.17.gemfile.lock
|
110
|
-
- gemfiles/rails_3.0.18.gemfile.lock
|
111
|
-
- gemfiles/rails_3.0.19.gemfile.lock
|
112
|
-
- gemfiles/rails_3.0.20.gemfile.lock
|
113
|
-
- gemfiles/rails_3.0.5.gemfile.lock
|
114
|
-
- gemfiles/rails_3.0.6.gemfile.lock
|
115
|
-
- gemfiles/rails_3.0.7.gemfile.lock
|
116
|
-
- gemfiles/rails_3.0.8.gemfile.lock
|
117
|
-
- gemfiles/rails_3.0.9.gemfile.lock
|
118
|
-
- gemfiles/rails_3.1.0.gemfile.lock
|
119
|
-
- gemfiles/rails_3.1.10.gemfile.lock
|
120
|
-
- gemfiles/rails_3.1.11.gemfile.lock
|
121
|
-
- gemfiles/rails_3.1.12.gemfile.lock
|
122
|
-
- gemfiles/rails_3.1.2.gemfile.lock
|
123
|
-
- gemfiles/rails_3.1.3.gemfile.lock
|
124
|
-
- gemfiles/rails_3.1.4.gemfile.lock
|
125
|
-
- gemfiles/rails_3.1.5.gemfile.lock
|
126
|
-
- gemfiles/rails_3.1.6.gemfile.lock
|
127
|
-
- gemfiles/rails_3.1.7.gemfile.lock
|
128
|
-
- gemfiles/rails_3.1.8.gemfile.lock
|
129
|
-
- gemfiles/rails_3.1.9.gemfile.lock
|
130
|
-
- gemfiles/rails_3.2.0.gemfile.lock
|
131
|
-
- gemfiles/rails_3.2.1.gemfile.lock
|
132
|
-
- gemfiles/rails_3.2.10.gemfile.lock
|
133
|
-
- gemfiles/rails_3.2.11.gemfile.lock
|
134
|
-
- gemfiles/rails_3.2.12.gemfile.lock
|
135
|
-
- gemfiles/rails_3.2.13.gemfile.lock
|
136
|
-
- gemfiles/rails_3.2.14.gemfile.lock
|
137
|
-
- gemfiles/rails_3.2.15.gemfile.lock
|
138
|
-
- gemfiles/rails_3.2.16.gemfile.lock
|
139
|
-
- gemfiles/rails_3.2.17.gemfile.lock
|
140
|
-
- gemfiles/rails_3.2.18.gemfile.lock
|
141
|
-
- gemfiles/rails_3.2.19.gemfile.lock
|
142
|
-
- gemfiles/rails_3.2.2.gemfile.lock
|
143
|
-
- gemfiles/rails_3.2.20.gemfile.lock
|
144
|
-
- gemfiles/rails_3.2.21.gemfile.lock
|
145
|
-
- gemfiles/rails_3.2.22.gemfile.lock
|
146
|
-
- gemfiles/rails_3.2.3.gemfile.lock
|
147
|
-
- gemfiles/rails_3.2.4.gemfile.lock
|
148
|
-
- gemfiles/rails_3.2.5.gemfile.lock
|
149
|
-
- gemfiles/rails_3.2.6.gemfile.lock
|
150
|
-
- gemfiles/rails_3.2.7.gemfile.lock
|
151
|
-
- gemfiles/rails_3.2.8.gemfile.lock
|
152
|
-
- gemfiles/rails_3.2.9.gemfile.lock
|
153
|
-
- gemfiles/rails_4.0.0.gemfile
|
154
|
-
- gemfiles/rails_4.0.0.gemfile.lock
|
155
|
-
- gemfiles/rails_4.0.1.gemfile
|
156
|
-
- gemfiles/rails_4.0.1.gemfile.lock
|
157
|
-
- gemfiles/rails_4.0.10.gemfile
|
158
|
-
- gemfiles/rails_4.0.10.gemfile.lock
|
159
|
-
- gemfiles/rails_4.0.11.1.gemfile
|
160
|
-
- gemfiles/rails_4.0.11.1.gemfile.lock
|
161
|
-
- gemfiles/rails_4.0.11.gemfile
|
162
|
-
- gemfiles/rails_4.0.11.gemfile.lock
|
163
|
-
- gemfiles/rails_4.0.12.gemfile
|
164
|
-
- gemfiles/rails_4.0.12.gemfile.lock
|
165
|
-
- gemfiles/rails_4.0.13.gemfile
|
166
|
-
- gemfiles/rails_4.0.13.gemfile.lock
|
167
|
-
- gemfiles/rails_4.0.2.gemfile
|
168
|
-
- gemfiles/rails_4.0.2.gemfile.lock
|
169
|
-
- gemfiles/rails_4.0.3.gemfile
|
170
|
-
- gemfiles/rails_4.0.3.gemfile.lock
|
171
|
-
- gemfiles/rails_4.0.4.gemfile
|
172
|
-
- gemfiles/rails_4.0.4.gemfile.lock
|
173
|
-
- gemfiles/rails_4.0.5.gemfile
|
174
|
-
- gemfiles/rails_4.0.5.gemfile.lock
|
175
|
-
- gemfiles/rails_4.0.6.gemfile
|
176
|
-
- gemfiles/rails_4.0.6.gemfile.lock
|
177
|
-
- gemfiles/rails_4.0.7.gemfile
|
178
|
-
- gemfiles/rails_4.0.7.gemfile.lock
|
179
|
-
- gemfiles/rails_4.0.8.gemfile
|
180
|
-
- gemfiles/rails_4.0.8.gemfile.lock
|
181
|
-
- gemfiles/rails_4.0.9.gemfile
|
182
|
-
- gemfiles/rails_4.0.9.gemfile.lock
|
183
|
-
- gemfiles/rails_4.1.0.gemfile
|
184
|
-
- gemfiles/rails_4.1.0.gemfile.lock
|
185
|
-
- gemfiles/rails_4.1.1.gemfile
|
186
|
-
- gemfiles/rails_4.1.1.gemfile.lock
|
187
|
-
- gemfiles/rails_4.1.10.gemfile
|
188
|
-
- gemfiles/rails_4.1.10.gemfile.lock
|
189
|
-
- gemfiles/rails_4.1.11.gemfile
|
190
|
-
- gemfiles/rails_4.1.11.gemfile.lock
|
191
|
-
- gemfiles/rails_4.1.12.gemfile
|
192
|
-
- gemfiles/rails_4.1.12.gemfile.lock
|
193
|
-
- gemfiles/rails_4.1.13.gemfile
|
194
|
-
- gemfiles/rails_4.1.13.gemfile.lock
|
195
|
-
- gemfiles/rails_4.1.14.1.gemfile
|
196
|
-
- gemfiles/rails_4.1.14.1.gemfile.lock
|
197
|
-
- gemfiles/rails_4.1.14.2.gemfile
|
198
|
-
- gemfiles/rails_4.1.14.2.gemfile.lock
|
199
|
-
- gemfiles/rails_4.1.14.gemfile
|
200
|
-
- gemfiles/rails_4.1.14.gemfile.lock
|
201
|
-
- gemfiles/rails_4.1.15.gemfile
|
202
|
-
- gemfiles/rails_4.1.15.gemfile.lock
|
203
|
-
- gemfiles/rails_4.1.2.gemfile
|
204
|
-
- gemfiles/rails_4.1.2.gemfile.lock
|
205
|
-
- gemfiles/rails_4.1.3.gemfile
|
206
|
-
- gemfiles/rails_4.1.3.gemfile.lock
|
207
|
-
- gemfiles/rails_4.1.4.gemfile
|
208
|
-
- gemfiles/rails_4.1.4.gemfile.lock
|
209
|
-
- gemfiles/rails_4.1.5.gemfile
|
210
|
-
- gemfiles/rails_4.1.5.gemfile.lock
|
211
|
-
- gemfiles/rails_4.1.6.gemfile
|
212
|
-
- gemfiles/rails_4.1.6.gemfile.lock
|
213
|
-
- gemfiles/rails_4.1.7.1.gemfile
|
214
|
-
- gemfiles/rails_4.1.7.1.gemfile.lock
|
215
|
-
- gemfiles/rails_4.1.7.gemfile
|
216
|
-
- gemfiles/rails_4.1.7.gemfile.lock
|
217
|
-
- gemfiles/rails_4.1.8.gemfile
|
218
|
-
- gemfiles/rails_4.1.8.gemfile.lock
|
219
|
-
- gemfiles/rails_4.1.9.gemfile
|
220
|
-
- gemfiles/rails_4.1.9.gemfile.lock
|
221
|
-
- gemfiles/rails_4.2.0.gemfile
|
222
|
-
- gemfiles/rails_4.2.0.gemfile.lock
|
223
|
-
- gemfiles/rails_4.2.1.gemfile
|
224
|
-
- gemfiles/rails_4.2.1.gemfile.lock
|
225
|
-
- gemfiles/rails_4.2.2.gemfile
|
226
|
-
- gemfiles/rails_4.2.2.gemfile.lock
|
227
|
-
- gemfiles/rails_4.2.3.gemfile
|
228
|
-
- gemfiles/rails_4.2.3.gemfile.lock
|
229
|
-
- gemfiles/rails_4.2.4.gemfile
|
230
|
-
- gemfiles/rails_4.2.4.gemfile.lock
|
231
|
-
- gemfiles/rails_4.2.5.1.gemfile
|
232
|
-
- gemfiles/rails_4.2.5.1.gemfile.lock
|
233
|
-
- gemfiles/rails_4.2.5.2.gemfile
|
234
|
-
- gemfiles/rails_4.2.5.2.gemfile.lock
|
235
|
-
- gemfiles/rails_4.2.5.gemfile
|
236
|
-
- gemfiles/rails_4.2.5.gemfile.lock
|
237
|
-
- gemfiles/rails_4.2.6.gemfile
|
238
|
-
- gemfiles/rails_4.2.6.gemfile.lock
|
239
|
-
- gemfiles/rails_4.2.7.1.gemfile
|
240
|
-
- gemfiles/rails_4.2.7.gemfile
|
241
|
-
- gemfiles/rails_4.2.8.gemfile
|
242
|
-
- gemfiles/rails_5.0.0.1.gemfile
|
243
|
-
- gemfiles/rails_5.0.0.gemfile
|
244
|
-
- gemfiles/rails_5.0.1.gemfile
|
245
|
-
- gemfiles/rails_5.0.1.gemfile.lock
|
246
|
-
- gemfiles/rails_5.0.2.gemfile
|
247
|
-
- gemfiles/rails_5.0.3.gemfile
|
248
|
-
- gemfiles/rails_5.1.0.gemfile
|
249
|
-
- gemfiles/rails_5.1.1.gemfile
|
86
|
+
- gemfiles/rails_5.0.7.gemfile
|
87
|
+
- gemfiles/rails_5.1.7.gemfile
|
88
|
+
- gemfiles/rails_5.2.3.gemfile
|
89
|
+
- gemfiles/rails_5.2.4.gemfile
|
90
|
+
- gemfiles/rails_5.2.5.gemfile
|
91
|
+
- gemfiles/rails_6.0.3.gemfile
|
92
|
+
- gemfiles/rails_6.1.0.gemfile
|
250
93
|
- lib/store_base_sti_class.rb
|
251
94
|
- lib/store_base_sti_class/version.rb
|
252
|
-
- lib/store_base_sti_class_for_4_0.rb
|
253
|
-
- lib/store_base_sti_class_for_4_1.rb
|
254
|
-
- lib/store_base_sti_class_for_4_2.rb
|
255
95
|
- lib/store_base_sti_class_for_5_0.rb
|
256
96
|
- lib/store_base_sti_class_for_5_1.rb
|
97
|
+
- lib/store_base_sti_class_for_5_2.rb
|
98
|
+
- lib/store_base_sti_class_for_6_0.rb
|
99
|
+
- lib/store_base_sti_class_for_6_1.rb
|
257
100
|
- store_base_sti_class.gemspec
|
258
|
-
- storebasestiname_unittest.sql
|
259
101
|
homepage: http://github.com/appfolio/store_base_sti_class
|
260
102
|
licenses:
|
261
103
|
- MIT
|
262
104
|
metadata: {}
|
263
|
-
post_install_message:
|
105
|
+
post_install_message:
|
264
106
|
rdoc_options: []
|
265
107
|
require_paths:
|
266
108
|
- lib
|
@@ -275,10 +117,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
275
117
|
- !ruby/object:Gem::Version
|
276
118
|
version: '0'
|
277
119
|
requirements: []
|
278
|
-
|
279
|
-
|
280
|
-
signing_key:
|
120
|
+
rubygems_version: 3.2.3
|
121
|
+
signing_key:
|
281
122
|
specification_version: 4
|
282
|
-
summary: Modifies ActiveRecord 4.
|
123
|
+
summary: Modifies ActiveRecord 4.2.x - 6.0.x with the ability to store the actual
|
283
124
|
class (instead of the base class) in polymorhic _type columns when using STI
|
284
125
|
test_files: []
|