IN NEED OF EXPLANATION:
class Comment < ActiveRecord::Base
def must_be_friends errors.add_to_base("Must be friends to leave a comment") unless commenter.friend_of?(commentee) end
The above code comes from rails documentation. There is a similar
example inAgile Web D. with Rails by Dave T. and Sam Ruby.
my understanding is that:
is a method call to the validate method within the ActiveRecord::Base
class. Supposedly it’s contents are:
This of course does not work with ruby because the validate method does
not take parameters.
Is metaporgramming being used? Tnis seems like some sort of Rails
I’m trying to get back into Rails after my first attempt.