長いな。うまくかみ砕けてない証拠ですね。 GitHub みたいなものを作ってるんだと思ってください: こういうモデルがあるとする。有料課金していないユーザーは非公開レポジトリを1個までしか作れない。 class User < ActiveRecord::Base has_many :repositories def paid? self.payment_flag end end class Repository < ActiveRecord::Base belongs_to :user def before_create unless user.paid? if self.publicity == false && user.repositories.count(:conditions => ['publicity = ?', false]) > 0 return false end en