Skip to content

Instantly share code, notes, and snippets.

@carlosbrando
Created July 28, 2008 18:08
Show Gist options
  • Save carlosbrando/2924 to your computer and use it in GitHub Desktop.
Save carlosbrando/2924 to your computer and use it in GitHub Desktop.
class Post < ActiveRecord::Base
has_many :comments
def comments=(attrs_array)
attrs_array.each do |attrs|
comments.create(attrs)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment