Created
December 1, 2010 16:43
-
-
Save olvap/723765 to your computer and use it in GitHub Desktop.
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
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