我一直在尝试将我学校的基于 ruby on rails 的fedena 项目从 mySQL 转换为 postgreSQL 以进行 heroku 部署,但遇到以下错误:
显示第 40 行引发的 app/views/class_timings/index.html.erb:
PG::Error: ERROR: syntax error at or near "."
LINE 1: SELECT `batches`.*,CONCAT(courses.code,'-',batches.name) as ...
^
: SELECT `batches`.*,CONCAT(courses.code,'-',batches.name) as course_full_name FROM "batches" INNER JOIN "courses" ON "courses".id = "batches".course_id WHERE ("batches"."is_deleted" = 'f' AND "batches"."is_active" = 't') ORDER BY course_full_name
提取的源代码(大约第 40 行):
37: <label ><%= t('select_a_batch') %>:</label>
38: <div class="text-input-bg">
39: <%= select :batch, :id,
40: @batches.map {|b| [b.full_name, b.id] },
41: {:prompt => "#{t('common')}"},
42: {:onchange => "#{remote_function(
43: :url => { :action => 'show' },
44: :with => "'batch_id='+value",
45: :before => "Element.show('loader')",
46: :success => "Element.hide('loader')"
47: )}"} %>
显然,我是编程新手!请帮忙。
控制器:
class_timings_controller.rb
def index
@batches = Batch.active
@class_timings = ClassTiming.find(:all,:conditions => { :batch_id => nil,:is_deleted=>false}, :order =>'start_time ASC')
end