Created
May 6, 2019 10:52
-
-
Save MittalPatel-BTC/05dbd78cdc55a9c03d2c73019c1900a3 to your computer and use it in GitHub Desktop.
Rails 5.2 update_columns changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rails 5.2 | |
> User.first.update_columns(office_email: '[email protected]') | |
SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT $1 [["LIMIT", 1]] | |
UPDATE "users" SET "office_email" = $1 WHERE "users"."id" = $2 [["office_email", "[email protected]"], ["id", 1]] | |
=> Traceback (most recent call last): | |
1: from (irb):8 | |
ActiveRecord::StatementInvalid (PG::UndefinedColumn: ERROR: column "office_email" of relation "users" does not exist) | |
LINE 1: UPDATE "users" SET "office_email" = $1 WHERE "users"."id" = $2 | |
^ | |
: UPDATE "users" SET "office_email" = $1 WHERE "users"."id" = $2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment