lib/souls/api/generate/resolver.rb in souls-0.48.2 vs lib/souls/api/generate/resolver.rb in souls-0.49.0
- old
+ new
@@ -32,12 +32,12 @@
f.each_line.with_index do |line, _i|
if @on
break if line.include?("t.index") || line.strip == "end"
field = "[String]" if line.include?("array: true")
- type, name = get_type_and_name(line)
- field ||= type_check(type)
+ type, name = Souls.get_type_and_name(line)
+ field ||= Souls.type_check(type)
case name
when "user_id"
@user_exist = true
when /$*_id\z/
@relation_params << name
@@ -46,11 +46,11 @@
next
else
new_line.write(" argument :#{name}, #{field}, required: false\n")
end
end
- @on = true if table_check(line: line, class_name: class_name)
+ @on = true if Souls.table_check(line: line, class_name: class_name)
end
end
end
end
@@ -87,11 +87,11 @@
File.open(path, "r") do |f|
f.each_line.with_index do |line, _i|
if @on
break if line.include?("t.index") || line.strip == "end"
- type, name = get_type_and_name(line)
+ type, name = Souls.get_type_and_name(line)
if line.include?("array: true")
new_line.write(
" scope = scope.where(\"#{name} @> ARRAY[?]::text[]\", value[:#{name}]) if value[:#{name}]\n"
)
next
@@ -113,10 +113,10 @@
else
new_line.write(" scope = scope.where(#{name}: value[:#{name}]) if value[:#{name}]\n")
end
end
end
- @on = true if table_check(line: line, class_name: class_name)
+ @on = true if Souls.table_check(line: line, class_name: class_name)
end
end
end
end