점점 오류 :ROR Heroku가 포스트 그레스 문제
ActiveRecord::StatementInvalid (PGError: ERROR: argument of HAVING must be type boolean, not type timestamp without time zone
컨트롤러 코드 :
def inactive
@number_days = params[:days].to_i || 90
@clients = Client.find(:all,
:include => :appointments,
:conditions => ["clients.user_id = ? AND appointments.start_time <= ?", current_user.id, @number_days.days.ago],
:group => 'client_id',
:having => 'MAX(appointments.start_time)'
)
end
이
:having => ['MAX(appointments.start_time) <= ?', @number_days.days.ago]
에
:having => 'MAX(appointments.start_time)'
을 변경하고 현재 오류가 있습니다 :
난 당신이 BY 절 HAVING 및 GROUP, SQL의 WHERE에 브러시 좋습니다. http://www.w3schools.com/sql/sql_having.asp. 이것은 Rails 문제가 아닙니다. – JRL
그래, 그 postgres 확실히 엄격한 다음 sqlite 건, 그냥 솔루션을 찾으려고 노력 .... 아직 학습 – sysconfig