Displaying 1 result from an estimated 1 matches for "queroseragil".
2008 Mar 18
6
Problem with mocking a simple has_many relationship
Hi there all. Sorry if the question sounds silly but i''m rather new at
the ''mocking'' stuff... So here is my problem (code helps more than
talking):
the model:
class Item < ActiveRecord::Base
...
has_many :images, :dependent => :destroy
...
protected
def validate
errors.add(:images, "cannot be empty") if self.images.count
end
end
the