Rails 4.1.0 从 rails 4.0.0 升级后的未定义方法“调用”
Rails 4.1.0 undefined method `call' for after upgrading from rails 4.0.0
您好,我已经从 rails 4.0.0 升级到 Rails 4.1.0
现在我得到这个错误:
当我删除
.active
它有效...但是为什么呢?我该如何解决这个问题?
course.rb
self.inheritance_column = :_type_disabled
has_and_belongs_to_many :clients, :join_table => :clients_courses # TODO c
has_many :memberships, :dependent => :destroy
has_many :users, :through => :memberships
has_many :lessons,
-> {order "lessons.sort ASC, lessons.start_date"},
:dependent => :destroy,
:foreign_key => :course_object_id
scope :active, where(:active => true)
scope :inactive, where(:active => false)
scope :active, -> { where(:active => true) }
scope :inactive, -> { where(:active => false) }
You should provide lambda to the scope 在你的 course.rb
:
scope :active, -> { where active: true }
scope :inactive, -> { where active: false }
您好,我已经从 rails 4.0.0 升级到 Rails 4.1.0
现在我得到这个错误:
当我删除
.active
它有效...但是为什么呢?我该如何解决这个问题?
course.rb
self.inheritance_column = :_type_disabled
has_and_belongs_to_many :clients, :join_table => :clients_courses # TODO c
has_many :memberships, :dependent => :destroy
has_many :users, :through => :memberships
has_many :lessons,
-> {order "lessons.sort ASC, lessons.start_date"},
:dependent => :destroy,
:foreign_key => :course_object_id
scope :active, where(:active => true)
scope :inactive, where(:active => false)
scope :active, -> { where(:active => true) }
scope :inactive, -> { where(:active => false) }
You should provide lambda to the scope 在你的 course.rb
:
scope :active, -> { where active: true }
scope :inactive, -> { where active: false }