0

Not updating postgresql database when update_all using

@change_stat = Notification.where("fb_id = ? AND active = ?",@current_user.fb_id,true)
@change_stat.update_all(:active => false)
5
  • 1
    are you getting any errors? Commented Jun 21, 2013 at 11:50
  • no, but i could see that update set active = false, but not reflect in postgresql databse
    – saran
    Commented Jun 21, 2013 at 11:52
  • what type of column is active? is it a boolean or string? Commented Jun 21, 2013 at 11:57
  • if active is not set as attr_accessible in your model this will not update. You need to call .save separetely
    – user1349666
    Commented Jun 21, 2013 at 12:08
  • That's not a query. Please show the SQL, and the exact error if any. Enable logging in RAils or set log_statement = 'all' in postgresql.conf. Commented Jun 21, 2013 at 12:28

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.