Skip to content

Instantly share code, notes, and snippets.

@donpdonp
Created July 6, 2010 17:36
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 donpdonp/465669 to your computer and use it in GitHub Desktop.
Save donpdonp/465669 to your computer and use it in GitHub Desktop.
class Diaria < ActiveRecord::Base
has_many :itens, :class_name => "DiariaItem"
def gerarItensDiaria
itens.create({:tipo => 3,
:quantidade => diaria_com_pernoite,
:valor => 150.00})
end
end
class DiariaItem < ActiveRecord::Base
belongs_to :diaria
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment