Sha256: 5d5894bdb4c20ccaa9181e107b0c69d00997be7776a9751d3dff81f34142d859

Contents?: true

Size: 870 Bytes

Versions: 2

Compression:

Stored size: 870 Bytes

Contents

module Ckeditor
  module Helpers
    module Controllers
      extend ActiveSupport::Concern
      
      protected
        
        def ckeditor_current_user
          instance_eval &Ckeditor.current_user_method
        end

        def ckeditor_authorize!
          instance_eval &Ckeditor.authorize_with
        end
        
        def ckeditor_before_create_asset(asset)
          asset.assetable = ckeditor_current_user if ckeditor_current_user
          return true
        end
        
        def ckeditor_pictures_scope(options = {})
          ckeditor_filebrowser_scope(options)
        end
        
        def ckeditor_attachment_files_scope(options = {})
          ckeditor_filebrowser_scope(options)
        end
        
        def ckeditor_filebrowser_scope(options = {})
          { :order => [:id, :desc] }.merge(options)
        end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ckeditor-4.0.9 lib/ckeditor/helpers/controllers.rb
ckeditor-4.0.8 lib/ckeditor/helpers/controllers.rb