Hi,
Is there a way to test the relationships of my models exist wwihtin my
new unit tests?
e.g. test this is here
class Blog < ActiveRecord::Base
belongs_to :user
end
and so is this?
class User< ActiveRecord::Base
has_many :blogs
end
thanks
Hi,
Is there a way to test the relationships of my models exist wwihtin my
new unit tests?
e.g. test this is here
class Blog < ActiveRecord::Base
belongs_to :user
end
and so is this?
class User< ActiveRecord::Base
has_many :blogs
end
thanks
On Jun 29, 2007, at 11:18 AM, Mark wrote:
and so is this?
class User< ActiveRecord::Base
has_many :blogs
endthanks
User.reflect_on_association(:blogs).macro # returns :has_many
See more in the docs:
http://api.rubyonrails.org/classes/ActiveRecord/Reflection/
ClassMethods.html
-Rob
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs