diff --git a/lib/cmtool.rb b/lib/cmtool.rb index 881e86f..fac86ae 100644 --- a/lib/cmtool.rb +++ b/lib/cmtool.rb @@ -11,7 +11,7 @@ require 'email_validator' # handles thumbnail generation via MiniMagick. # Replace `include Paperclip::Glue` + `has_attached_file` with # `include SimplyStored::HasAttachment` + `has_attachment` -require 'simply_stored/has_attachment' +# has_attachment now in simply_stored gem module Cmtool end diff --git a/lib/simply_stored/has_attachment.rb b/lib/simply_stored/has_attachment.rb deleted file mode 100644 index 57ca797..0000000 --- a/lib/simply_stored/has_attachment.rb +++ /dev/null @@ -1,225 +0,0 @@ -# frozen_string_literal: true - -module SimplyStored - # Drop-in replacement for Paperclip in SimplyStored/CouchDB models. - # - # Usage (replaces `include Paperclip::Glue` + `has_attached_file`): - # - # class Image - # include SimplyStored::Couch - # include SimplyStored::HasAttachment - # - # has_attachment :file, styles: { - # medium: "354x1000>", - # thumb: "160x1250>" - # } - # - # # Validations (standard Rails, replaces validates_attachment) - # validate :file_content_type_must_be_image - # - # private - # - # def file_content_type_must_be_image - # return if file.blank? - # unless %w[image/jpeg image/gif image/png].include?(file_content_type) - # errors.add(:file, :invalid_content_type) - # end - # end - # end - # - # The module auto-declares CouchDB properties for: - # _file_name, _content_type, _file_size, _updated_at - # - # Files are stored on disk at: - # public/system///original. - # public/system///