Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 MIT-LICENSE
Octocat-spinner-32 README
Octocat-spinner-32 Rakefile
Octocat-spinner-32 init.rb
Octocat-spinner-32 install.rb
Octocat-spinner-32 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.