File tree Expand file tree Collapse file tree 1 file changed +1
-28
lines changed
app/services/forest_liana Expand file tree Collapse file tree 1 file changed +1
-28
lines changed Original file line number Diff line number Diff line change @@ -31,11 +31,7 @@ def self.find_model_from_collection_name(collection_name, logs = false)
31
31
if model . abstract_class?
32
32
model_found = self . find_model_from_abstract_class ( model , collection_name )
33
33
elsif ForestLiana . name_for ( model ) == collection_name
34
- if self . sti_child? ( model )
35
- model_found = model
36
- else
37
- model_found = model . base_class
38
- end
34
+ model_found = model
39
35
end
40
36
41
37
break if model_found
@@ -90,28 +86,5 @@ def self.habtm?(model)
90
86
def self . is_active_type? model
91
87
Object . const_defined? ( 'ActiveType::Object' ) && model < ActiveType ::Object
92
88
end
93
-
94
- def self . sti_child? ( model )
95
- begin
96
- parent = model . try ( :superclass )
97
- return false unless parent . try ( :table_name )
98
-
99
- if ForestLiana . name_for ( parent )
100
- inheritance_column = parent . columns . find do |column |
101
- ( parent . inheritance_column && column . name == parent . inheritance_column ) \
102
- || column . name == 'type'
103
- end
104
-
105
- return inheritance_column . present?
106
- end
107
- rescue NoMethodError
108
- # NOTICE: ActiveRecord::Base throw the exception "undefined method
109
- # `abstract_class?' for Object:Class" when calling the existing method
110
- # "table_name".
111
- return false
112
- end
113
-
114
- return false
115
- end
116
89
end
117
90
end
You can’t perform that action at this time.
0 commit comments