첫 번째 :
class CountryList < ActiveRecord::Base
has_one :country, :dependent => :nullify
end
두 번째 :
class Country < ActiveRecord::Base
belongs_to :country_list
end
국가와 연관없이 모든 레코드를 포함하는 CountryList 모델에서 범위를 만들어야합니다.
Smth like :
CountryList.all.each do |country_list|
country_list.country.nil?
end