0
만료 된 스페셜이있는 레일 앱을 만듭니다. 누군가가 로그온 할 때마다 이미 만료 된 스페셜을 찾는 Def가 있습니다. 그것은 로컬에서 잘 작동하지만 내가 Heroku가에 배포 할 때이 오류가 얻을 :Heroku PostgreSQL에서 "<="연산자를 사용할 때 오류가 발생합니다.
ActiveRecord::StatementInvalid (PG::UndefinedFunction: ERROR: operator does not exist: character varying <= numeric
와 힌트 : 여기에
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
내가 만든 데프입니다. 나는
def check_expired
time = DateTime.now.to_f.to_s
@specials = Special.where("expires <= #{DateTime.now.to_f.to_s}")
@specials.destroy_all
end