阅读背景:

如何在Rails中为模型的哈希属性创建客户序列化程序?

来源:互联网 

I have the following

我有以下内容

class User < ApplicationRecord
  class JSONEncrypted
    def load(dbtext)
      JSON.load dbtext.decrypt
    end
    def dump(hash)
      (JSON.dump hash).encrypt
    end
  end
  store :profile, accessors: [:dob], coder: JSONEncrypted
class User < Ap



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

分享到: