Displaying 2 results from an estimated 2 matches for "is_account_owner".
2007 Sep 04
3
Model Specs: Fixtures vs Mocks + Stubs?
What is the general opinion about fixtures versus mocking and stubbing
in model specs? I heard from agile on IRC that they save the database
testing for integration testing, but I also see that the caboose
sample applicaiton uses fixtures. I also noticed that on the rspec
site, it says "Ironically (for the traditional TDD''er) these are the
only specs that we feel should actually
2006 Jan 05
3
has_one :dependent => true question
Hello,
I have two classes that are self explanatory and are listed below.
class User < ActiveRecord::Base
belongs_to :account
end
class Account < ActiveRecord::Base
has_one :account_owner, { :dependent => true, :class_name => "User",
:conditions => "is_account_owner = 1" }
has_many :users
end
In the signup controller when an account is created one user is created as
well that is the account_owner (similar to how Basecamp does it). My
question is how to ensure that either the account is created and the user is
created or nothing is saved.
It seems lik...