Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib rake tasks go to the lib directory for newer rails
test
.gitignore
MIT-LICENSE
README
Rakefile
init.rb
install.rb
uninstall.rb

README

PaperclipWithUnifiedTable
=========================

Introduction goes here.


Example
=======

create_table :unified_uploads do |t|
  t.string  :uploadable_type
  t.integer :uploadable_id
  t.string  :flavor
  t.string  :content_file_name
  t.string  :content_content_type
  t.string  :content_file_size
  t.string  :content_updated_at
  t.timestamps
end

class UnifiedUpload < ActiveRecord::Base
  belongs_to :uploadable, :polymorphic => true
  has_attached_file :content
  validates_presence_of :flavor 
end

Example goes here.


Copyright (c) 2009 [name of plugin creator], released under the MIT license

# should have the default table name be configurable
# don't really need to namespace the 'flavor' column; it's already polymorphic
# auto-generate the migration for the One True Table
# need to reflect to override the associations
# should require validation of flavor; we could even make sure it's one of the indicated flavors
  by tracking associations
# assumes the existance of the UnifiedUpload class
Something went wrong with that request. Please try again.