module Shrine::Plugins::CachedAttachmentData::AttachmentMethods

  1. lib/shrine/plugins/cached_attachment_data.rb

Methods

Public Class

  1. new

Public Class methods

new (*)
[show source]
# File lib/shrine/plugins/cached_attachment_data.rb, line 20
        def initialize(*)
          super

          module_eval "            def cached_#{@name}_data
              #{@name}_attacher.read_cached
            end

            def cached_#{@name}_data=(value)
              Shrine.deprecation("Calling #cached_#{@name}_data= is deprecated and will be removed in Shrine 3. You should use the original field name: `f.hidden_field :#{@name}, value: record.cached_#{@name}_data`.")
              #{@name}_attacher.assign(value)
            end
", __FILE__, __LINE__ + 1
        end