Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-3546

undefined method `after_commit'

    • Type: Icon: Task Task
    • Resolution: Done
    • 12_01_17
    • Affects Version/s: None
    • Component/s: None
    • None

      Rails: 4.0.3
      Mongoid: 4.0.0.beta1
      mongoid-paperclip: 0.0.8

      Can't upload file with paperclip get, I get an error

      `NoMethodError (undefined method 'after_commit' for Draft:Class):
      app/models/draft.rb:5:in '<class:Draft>'
      app/models/draft.rb:1:in '<top (required)>'
      app/controllers/drafts_controller.rb:27:in 'create'`

      `class Draft
      include Mongoid::Document
      include Mongoid::Paperclip

      has_mongoid_attached_file :image,
      :path => ':attachment/:id/:style.:extension',
      :storage => :s3,
      :s3_credentials => File.join(Rails.root, 'config', 'aws.yml'),
      :styles => {
      :small => ['298x160#', :png]
      }
      end`

            Assignee:
            Unassigned Unassigned
            Reporter:
            Stajor Stajor [X]
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: