Skip to content

Instantly share code, notes, and snippets.

@Nakort
Created July 17, 2012 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nakort/3132150 to your computer and use it in GitHub Desktop.
Save Nakort/3132150 to your computer and use it in GitHub Desktop.
RubyVE
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