NoMethodError (undefined method `sql_type' for "NUMBER":String):
app/controllers/strategy_backlogs_controller.rb:395:in `retrieve_strate_line_increment_ers'
app/controllers/strategy_backlogs_controller.rb:114:in `show'
Full Trace
activerecord (5.0.0.1) lib/active_record/connection_adapters/column.rb:8:in `sql_type'
activerecord (5.0.0.1) lib/active_record/connection_adapters/abstract/quoting.rb:63:in `lookup_cast_type_from_column'
activerecord (5.0.0.1) lib/active_record/model_schema.rb:359:in `block in load_schema!'
activerecord (5.0.0.1) lib/active_record/model_schema.rb:355:in `each'
activerecord (5.0.0.1) lib/active_record/model_schema.rb:355:in `load_schema!'
activerecord (5.0.0.1) lib/active_record/attributes.rb:233:in `load_schema!'
activerecord (5.0.0.1) lib/active_record/attribute_decorators.rb:28:in `load_schema!'
activerecord (5.0.0.1) lib/active_record/model_schema.rb:349:in `load_schema'
activerecord (5.0.0.1) lib/active_record/model_schema.rb:256:in `columns_hash'
activerecord (5.0.0.1) lib/active_record/querying.rb:41:in `find_by_sql'
app/controllers/strategy_backlogs_controller.rb:395:in `retrieve_strate_line_increment_ers'
app/controllers/strategy_backlogs_controller.rb:114:in `show'
报错地方的相关代码
for i in 0...in_size
in_query.push("RPTNO in (#{all_bug_numbers[max_params_length*i...max_params_length*(i+1)].join(",")})")
end
bugs = Bug.find_by_sql("SELECT RPTNO, SUBJECT, STATUS, PRI_FOR_DEV, PROGRAMMER, CUSTOMER from RPTHEAD WHERE (#{in_query.join(' OR ')})")
升级到 rails5,遇到的问题