Sha256: 083106971388905ea5ee025fcc45287b5fa3f19e5226e52d7c46b397617e9837
Contents?: true
Size: 563 Bytes
Versions: 19
Compression:
Stored size: 563 Bytes
Contents
module Protobuf module ActiveRecord class Transformer attr_accessor :callable, :options def initialize(callable, options = {}) @callable = callable @options = options end def call(proto) callable.call(proto) end def nullify?(proto) return false unless options[:nullify_on] return false unless proto.field?(:nullify) && proto.nullify.is_a?(Array) return false if proto.nullify.empty? proto.nullify.include?(options[:nullify_on].to_s) end end end end
Version data entries
19 entries across 19 versions & 1 rubygems