Module: Paperclip::Schema
- Defined in:
- lib/paperclip/schema.rb
Overview
Provides helper methods that can be used in migrations.
Defined Under Namespace
Modules: CommandRecorder, DeprecationHelper, Statements, TableDefinition
Constant Summary collapse
- COLUMNS =
{ file_name: :string, content_type: :string, file_size: :bigint, updated_at: :datetime }
Class Method Summary collapse
-
.column_options(options, column_name) ⇒ Object
Extract column-specific options and merge with general options.
- .included(_base) ⇒ Object
Class Method Details
.column_options(options, column_name) ⇒ Object
Extract column-specific options and merge with general options
19 20 21 22 23 |
# File 'lib/paperclip/schema.rb', line 19 def self.(, column_name) column_specific = [column_name.to_sym] || {} = .except(*COLUMNS.keys) .merge(column_specific) end |
.included(_base) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/paperclip/schema.rb', line 11 def self.included(_base) ActiveRecord::ConnectionAdapters::Table.include TableDefinition ActiveRecord::ConnectionAdapters::TableDefinition.include TableDefinition ActiveRecord::Migration.include Statements ActiveRecord::Migration::CommandRecorder.include CommandRecorder end |