diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-06-24 04:13:16 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-06-24 04:13:16 +0200 |
| commit | e0a7e0fec760ba12c8067a37e10c96f1f05876e2 (patch) | |
| tree | d0cf745592a46aee4d4913911fd34c7c24515220 /vendor/plugins/paperclip/generators | |
| parent | 6424e10be5a89f175a74c71c55660412a169b8b8 (diff) | |
Stage 1 complete: Rails 2.3.5 to Rails 3.2.22.5 upgrade
- Converted plugins to gems (Gemfile)
- Updated config structure (application.rb, boot.rb, environment.rb)
- Converted routes to Rails 3 DSL
- Converted named_scope to scope throughout models
- Converted find(:all, :conditions) to where() chains
- Fixed has_many :order to use ordering scope
- Updated session store and secret token configuration
- Fixed exception_notification middleware configuration
- Patched Ruby 2.4 / Rails 3.2 incompatibilities:
- Integer/Float duration arithmetic (ActiveSupport)
- Arel visit_Integer for PostgreSQL adapter
- create_database String/Integer coercion
- ActionController consider_all_requests_local
- Migrated taggings schema for acts-as-taggable-on
- Replaced dynamic_form gem with custom form_error_messages helper
- Fixed Rails 3 block helper syntax (form_for, form_tag, fields_for)
- Fixed admin layout yield
- Updated test suite for Rails 3 APIs
Diffstat (limited to 'vendor/plugins/paperclip/generators')
3 files changed, 0 insertions, 51 deletions
diff --git a/vendor/plugins/paperclip/generators/paperclip/USAGE b/vendor/plugins/paperclip/generators/paperclip/USAGE deleted file mode 100644 index 2d611d7d..00000000 --- a/vendor/plugins/paperclip/generators/paperclip/USAGE +++ /dev/null | |||
| @@ -1,5 +0,0 @@ | |||
| 1 | Usage: | ||
| 2 | |||
| 3 | script/generate paperclip Class attachment1 (attachment2 ...) | ||
| 4 | |||
| 5 | This will create a migration that will add the proper columns to your class's table. \ No newline at end of file | ||
diff --git a/vendor/plugins/paperclip/generators/paperclip/paperclip_generator.rb b/vendor/plugins/paperclip/generators/paperclip/paperclip_generator.rb deleted file mode 100644 index 77ee5a21..00000000 --- a/vendor/plugins/paperclip/generators/paperclip/paperclip_generator.rb +++ /dev/null | |||
| @@ -1,27 +0,0 @@ | |||
| 1 | class PaperclipGenerator < Rails::Generator::NamedBase | ||
| 2 | attr_accessor :attachments, :migration_name | ||
| 3 | |||
| 4 | def initialize(args, options = {}) | ||
| 5 | super | ||
| 6 | @class_name, @attachments = args[0], args[1..-1] | ||
| 7 | end | ||
| 8 | |||
| 9 | def manifest | ||
| 10 | file_name = generate_file_name | ||
| 11 | @migration_name = file_name.camelize | ||
| 12 | record do |m| | ||
| 13 | m.migration_template "paperclip_migration.rb.erb", | ||
| 14 | File.join('db', 'migrate'), | ||
| 15 | :migration_file_name => file_name | ||
| 16 | end | ||
| 17 | end | ||
| 18 | |||
| 19 | private | ||
| 20 | |||
| 21 | def generate_file_name | ||
| 22 | names = attachments.map{|a| a.underscore } | ||
| 23 | names = names[0..-2] + ["and", names[-1]] if names.length > 1 | ||
| 24 | "add_attachments_#{names.join("_")}_to_#{@class_name.underscore}" | ||
| 25 | end | ||
| 26 | |||
| 27 | end | ||
diff --git a/vendor/plugins/paperclip/generators/paperclip/templates/paperclip_migration.rb.erb b/vendor/plugins/paperclip/generators/paperclip/templates/paperclip_migration.rb.erb deleted file mode 100644 index eebb0e50..00000000 --- a/vendor/plugins/paperclip/generators/paperclip/templates/paperclip_migration.rb.erb +++ /dev/null | |||
| @@ -1,19 +0,0 @@ | |||
| 1 | class <%= migration_name %> < ActiveRecord::Migration | ||
| 2 | def self.up | ||
| 3 | <% attachments.each do |attachment| -%> | ||
| 4 | add_column :<%= class_name.underscore.camelize.tableize %>, :<%= attachment %>_file_name, :string | ||
| 5 | add_column :<%= class_name.underscore.camelize.tableize %>, :<%= attachment %>_content_type, :string | ||
| 6 | add_column :<%= class_name.underscore.camelize.tableize %>, :<%= attachment %>_file_size, :integer | ||
| 7 | add_column :<%= class_name.underscore.camelize.tableize %>, :<%= attachment %>_updated_at, :datetime | ||
| 8 | <% end -%> | ||
| 9 | end | ||
| 10 | |||
| 11 | def self.down | ||
| 12 | <% attachments.each do |attachment| -%> | ||
| 13 | remove_column :<%= class_name.underscore.camelize.tableize %>, :<%= attachment %>_file_name | ||
| 14 | remove_column :<%= class_name.underscore.camelize.tableize %>, :<%= attachment %>_content_type | ||
| 15 | remove_column :<%= class_name.underscore.camelize.tableize %>, :<%= attachment %>_file_size | ||
| 16 | remove_column :<%= class_name.underscore.camelize.tableize %>, :<%= attachment %>_updated_at | ||
| 17 | <% end -%> | ||
| 18 | end | ||
| 19 | end | ||
