view test/exemplars/comment_exemplar.rb @ 60:cf39b52d24b4 luisf

DEVELOPMENT COMMIT: The description can now be seen and edited BUT when a new user registers the informations is not saved to the correct table.
author luisf
date Wed, 01 Dec 2010 18:04:19 +0000
parents 513646585e45
children
line wrap: on
line source
class Comment < ActiveRecord::Base
  generator_for :commented, :method => :generate_news
  generator_for :author, :method => :generate_author
  generator_for :comments => 'What great news this is.'

  def self.generate_news
    News.generate!
  end

  def self.generate_author
    User.generate_with_protected!
  end
end