我使用Ruby和我在我的对象类创建了几个范围,但是当我把他们从我的代码中返回一个错误:声明范围不on Rails的3个工作
irb>Transaction.first.committed
=> undefined method `commited' for #
对象类:
class 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")
end
感谢您的帮助球员。 – 2012-07-05 18:10:44