Ruby on Rails 3を使用していて、オブジェクトクラスにいくつかのスコープを作成しましたが、コード内からそれらを呼び出すと、エラーが返されます。
irb> Transaction.first.committed
=>未定義のメソッドは#に対して「コミット」されています
オブジェクトクラス:
クラスTransaction<ActiveRecord:: Base
attr_accessible :amount, :description, :published, :task_description_id, :discrete_task_id, :transaction_type belongs_to :discrete_task scope :committed, where(:transaction_type => "committed") scope :obligated, where(:transaction_type => "obligated") scope :expensed, where(:transaction_type => "expensed")
終わり