Skip to content

Instantly share code, notes, and snippets.

@delonnewman
Created August 12, 2019 20:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save delonnewman/c28584b4bdb17c0061acfddc18f85f8e to your computer and use it in GitHub Desktop.
Save delonnewman/c28584b4bdb17c0061acfddc18f85f8e to your computer and use it in GitHub Desktop.
# model
class Referral
attributes :ended_at, :datetime
end
# migration
class CreateReferrals ...
def change
create_table :referrals do |t|
...
t.date :ended_at
end
end
end
# Query
Referral.where(id: id, referral_status_id: status_id).update_all(ended_at: DateTime.now)
# throws the error 'OCIError: ORA-01830: date format picture ends before converting entire input string:'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment