Created
July 17, 2012 21:14
-
-
Save Nakort/3132150 to your computer and use it in GitHub Desktop.
RubyVE
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
class TipoUsuario < ActiveRecord::Base | |
has_many :usuarios | |
end | |
class Usuario < AcitveRecord::Base | |
belongs_to :tipo_usuario | |
end | |
ti_usuario = TipoUsuario.create! | |
usrio = Usuario.new | |
usrio.tipo_usuario = ti_usuario | |
usrio.save |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment