我从Rails的4.1.9至4.2.2.In轨4.1.9 RSpec的是green.After升级,当我跑我的升级Rails应用程序测试中,我得到了几个rspec失败。 Rails version = 4.2.2
Ruby version = 2.2.4
rspec = 3.0.0
Following are the gems I used for testing,
gem 'rspec
我想在另一个序列化程序中使用序列化程序,所以我可以在顶层添加键值对,但看起来像当我这样做时,较低级别的序列化程序不工作anymore- 我的文件: 上述ItemsController class ItemsController
def index
open_items = Items.
select("distinct on (open_item_id) *").
class User < ApplicationRecord
enum status: [ :active, :inactive ]
end
默认情况下,主动型串行序列化User对象的status属性为一个字符串,要么"active"或"inactive",但我想它是整数0或1。要做到这样,我必须手动做到这一点: class UserSerializer < ActiveModel