我正在运行Feed.history
,但是由于在scope
模型中使用了Feed
行,因此在标题上出现了上述错误:scope :history, -> { or({:end.ne => nil}, {:end.lt => Time.current}) }
什么和为什么?!
最佳答案
尝试这个
scope :history, where('$or' => [{:end.ne => nil}, {:end.lt => Time.current}])
关于ruby-on-rails - 语法错误,意外的keyword_or范围,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22350240/