Skip to content

Instantly share code, notes, and snippets.

@MittalPatel-BTC
Created May 6, 2019 10:51
Show Gist options
  • Save MittalPatel-BTC/f976c68240bdbd9833a972c4d530e2ab to your computer and use it in GitHub Desktop.
Save MittalPatel-BTC/f976c68240bdbd9833a972c4d530e2ab to your computer and use it in GitHub Desktop.
Rails 6 update_columns changes
# Rails 6
> User.first.update_columns(office_email: 'mit@gmail.com')
SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
Traceback (most recent call last):
1: from (irb):1
ActiveModel::MissingAttributeError (can't write unknown attribute `office_email`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment