Skip to content

Instantly share code, notes, and snippets.

@AlainPilon
Created June 5, 2010 11:29
Show Gist options
  • Save AlainPilon/426550 to your computer and use it in GitHub Desktop.
Save AlainPilon/426550 to your computer and use it in GitHub Desktop.
class Visit < ActiveRecord::Base
before_validation {|record| record.visited_on = 'test'}
end
a = Visit.first
a.visited_on
=> nil
a.user_id
=> 1
a.user_id = 5
a.save
a.user_id
=>5
a.visited_on
=> nil #WTF?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment