阅读背景:

如何在Rails模型中将数组用作字段并将其转换为字符串?

来源:互联网 

There is the following model:

有以下型号:

class Post < ActiveRecord::Base
    default_scope { order(id: :desc) }

    validates :title, :content, :keywords, presence: true

    has_many :responses, dependent: :destroy

    scope :existing, ->{ where(deleted: false) }
    scope :enabled,  ->{ where(enabled: true) }
end
class 



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: