Skip to content

Commit

Permalink
Remove refile backend support
Browse files Browse the repository at this point in the history
  • Loading branch information
galetahub committed Mar 25, 2019
1 parent 36a6fcb commit 9824683
Show file tree
Hide file tree
Showing 18 changed files with 68 additions and 283 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ test/dummy/public/uploads/*
*.swp
.idea
.DS_Store
Gemfile.lock
Gemfile.lock
dragonfly.log
12 changes: 1 addition & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Rails.application.config.assets.precompile += %w( ckeditor/*)
For file upload support, you must generate the necessary file storage models.
The currently supported backends are:

* ActiveRecord (paperclip, carrierwave, dragonfly, refile)
* ActiveRecord (paperclip, carrierwave, dragonfly)
* Mongoid (paperclip, carrierwave, dragonfly)

### How to generate models to store uploaded files
Expand All @@ -67,15 +67,6 @@ gem 'mini_magick'
rails generate ckeditor:install --orm=active_record --backend=carrierwave
```

#### ActiveRecord + refile

```
gem 'refile', require: "refile/rails"
gem 'refile-mini_magick'
rails generate ckeditor:install --orm=active_record --backend=refile
```

#### ActiveRecord + dragonfly

Requires Dragonfly 1.0 or greater.
Expand Down Expand Up @@ -341,7 +332,6 @@ en:
```bash
$> rake test CKEDITOR_BACKEND=paperclip
$> rake test CKEDITOR_BACKEND=carrierwave
$> rake test CKEDITOR_BACKEND=refile
$> rake test CKEDITOR_BACKEND=dragonfly
$> rake test CKEDITOR_ORM=mongoid

Expand Down
1 change: 0 additions & 1 deletion lib/ckeditor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ module Backend
autoload :Paperclip, 'ckeditor/backend/paperclip'
autoload :CarrierWave, 'ckeditor/backend/carrierwave'
autoload :Dragonfly, 'ckeditor/backend/dragonfly'
autoload :Refile, 'ckeditor/backend/refile'
end

IMAGE_TYPES = %w[image/jpeg image/png image/gif image/jpg image/pjpeg image/tiff image/x-png].freeze
Expand Down
34 changes: 0 additions & 34 deletions lib/ckeditor/backend/refile.rb

This file was deleted.

19 changes: 3 additions & 16 deletions lib/generators/ckeditor/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class InstallGenerator < Rails::Generators::Base
desc: 'Backend processor for upload support'

class_option :backend, type: :string, default: 'paperclip',
desc: 'paperclip (default), carrierwave, refile or dragonfly'
desc: 'paperclip (default), carrierwave or dragonfly'

def self.source_root
@source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
Expand Down Expand Up @@ -56,9 +56,8 @@ def create_models
def create_ckeditor_migration
return unless ['active_record'].include?(orm)

migration_template "#{generator_dir}/#{migration_file}.rb",
File.join('db/migrate', 'create_ckeditor_assets.rb'),
migration_version: migration_version
migration_template "#{generator_dir}/migration.rb",
File.join('db/migrate', 'create_ckeditor_assets.rb')
end

protected
Expand Down Expand Up @@ -90,18 +89,6 @@ def orm
def backend
(options[:backend] || 'paperclip').to_s
end

def rails5?
Rails.version.start_with? '5'
end

def migration_version
"[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]"
end

def migration_file
rails5? ? 'migration_versioned' : 'migration'
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ def up
t.string :type, limit: 30

# Uncomment it to save images dimensions, if your need it
t.integer :width
t.integer :height
# t.integer :width
# t.integer :height

t.timestamps null: false
end
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

class CreateCkeditorAssets < ActiveRecord::Migration
def self.up
class CreateCkeditorAssets < ActiveRecord::Migration[5.2]
def up
create_table :ckeditor_assets do |t|
t.string :data_uid, null: false
t.string :data_name, null: false
Expand All @@ -10,16 +10,16 @@ def self.up
t.string :type, limit: 30

# Uncomment these to save image dimensions, if your need them.
t.integer :data_width
t.integer :data_height
# t.integer :data_width
# t.integer :data_height

t.timestamps null: false
end

add_index :ckeditor_assets, :type
end

def self.down
def down
drop_table :ckeditor_assets
end
end

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# frozen_string_literal: true

class CreateCkeditorAssets < ActiveRecord::Migration
def self.up
class CreateCkeditorAssets < ActiveRecord::Migration[5.2]
def up
create_table :ckeditor_assets do |t|
t.string :data_file_name, null: false
t.string :data_content_type
t.integer :data_file_size
t.string :data_fingerprint
t.string :type, limit: 30

# Uncomment it to save images dimensions, if your need it
t.integer :width
t.integer :height
# Uncomment it to save images dimensions, if your need it
# t.integer :width
# t.integer :height

t.timestamps null: false
end

add_index :ckeditor_assets, :type
end

def self.down
def down
drop_table :ckeditor_assets
end
end

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 9824683

Please sign in to comment.