Sha256: 4847ad1dacec760121a84b2561f5a4b5e52f90cefb55f22d1df3c505abcd5409
Contents?: true
Size: 445 Bytes
Versions: 8
Compression:
Stored size: 445 Bytes
Contents
require 'mongoid' module SimpleFormAttachments module Attachment extend ActiveSupport::Concern included do include Mongoid::Document field :temporary, type: Boolean, default: true scope :temporary, -> { where(temporary: true) } scope :permanent, -> { where(temporary: false) } def to_simple_form_partial_path ['simple_form_attachments', to_partial_path].join('/') end end end end
Version data entries
8 entries across 8 versions & 1 rubygems