rubyonrails-talk
August 28th, 2006, 11:03 AM
Hi,
I'm fairly new to RoR and I think I don't get some of the ActiveRecord
magic.
I have:
class Country < ActiveRecord::Base
has_many :breeders
validates_presence_of :name
end
class Breeder < ActiveRecord::Base
belongs_to :country
validates_presence_of :name
validates_associated :country # may be NIL when we don't know it yet
More... (http://groups.google.com/group/rubyonrails-talk/msg/2b544ac8751e91da)
I'm fairly new to RoR and I think I don't get some of the ActiveRecord
magic.
I have:
class Country < ActiveRecord::Base
has_many :breeders
validates_presence_of :name
end
class Breeder < ActiveRecord::Base
belongs_to :country
validates_presence_of :name
validates_associated :country # may be NIL when we don't know it yet
More... (http://groups.google.com/group/rubyonrails-talk/msg/2b544ac8751e91da)