Skip to content

Instantly share code, notes, and snippets.

@olvap
Created December 1, 2010 16:43
Show Gist options
  • Save olvap/723765 to your computer and use it in GitHub Desktop.
Save olvap/723765 to your computer and use it in GitHub Desktop.
models
Class User < ActiveRecord::Base
belongs_to :state
end
Class State < ActiveRecord::Base
end
#table state
id name
1 first state
2 state 2
3 state 3
5 state 5555
there is no 4 id.
so
:state_id => 3 is valid
:state_id => 4 not!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment