我正在使用 Ruby on Rails 3,并在我的对象类中创建了一些范围,但是当我从我的代码中调用它们时,它返回一个错误:
irb>Transaction.first.committed
=> 未定义的方法 `commited' for #
对象类:
类事务 < 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")
结尾