这两种方法有什么区别?
class Model < ActiveRecord::Base
def self.approved
self.where("approved = 1")
end
def self.approved
where approved: true
end
end
这两种方法有什么区别?
class Model < ActiveRecord::Base
def self.approved
self.where("approved = 1")
end
def self.approved
where approved: true
end
end