How to update Active Record from rails console

How to update Active record from back-end using rails console

While working on rails console I figured out SQL way to update an active record from rails console.
So I have to update flag value of a field ’email_dangling’ to ‘0’

so Steps are as:

1. bundle exec rails c production

2. ActiveRecord::Base.connection.execute ‘update emails set email_dangling = 0 where id = 1234’

And its done!