Skip to content

Instantly share code, notes, and snippets.

@michaeldhopkins
Created January 24, 2012 18:16
Show Gist options
  • Save michaeldhopkins/1671630 to your computer and use it in GitHub Desktop.
Save michaeldhopkins/1671630 to your computer and use it in GitHub Desktop.
irb(main):032:0> s.date = "11/9/2007"
=> "11/9/2007"
irb(main):033:0> s.date
=> Tue, 11 Sep 2007 00:00:00 UTC +00:00
irb(main):034:0> s.date = "2007/11/9"
=> "2007/11/9"
irb(main):035:0> s.date
=> Fri, 09 Nov 2007 00:00:00 UTC +00:00
irb(main):036:0>
The migration for this field:
class AddDateToSermons < ActiveRecord::Migration
def change
add_column :sermons, :date, :datetime
end
end
The model has no reference to date and the controller just mass assigns. Why is this happening?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment