Permalink
Browse files

README update

  • Loading branch information...
1 parent ef3efeb commit e18d9b7bc7d897fd6e5906fde9049bdc46ccce0e @solnic solnic committed Jul 12, 2011
Showing with 15 additions and 5 deletions.
  1. +15 −5 README.rdoc
View
@@ -3,18 +3,28 @@
This gem adds support for DataMapper to CarrierWave, see the CarrierWave
documentation for more detailed usage instructions.
-Install it like this:
+= Installation
gem install carrierwave-datamapper
-Use it like this:
+Using bundler:
+
+ gem 'carrierwave-datamapper', :require => 'carrierwave/datamapper'
+
+= Usage
require 'carrierwave/datamapper'
-Make sure to disable auto_validation on the mounted column.
+ class ImageUploader < CarrierWave::Uploader::Base
+ include CarrierWave::MiniMagick
+ end
-Using bundler:
+ class Image < Attachment
@watsoncj

watsoncj Jul 17, 2011

I'm running into this issue with the example. Where is Attachment defined?

$ padrino s /home/cwatson/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/ext/module.rb:36:inconst_missing': uninitialized constant Object::Attachment (NameError)
from /media/scratch/dev/cc/models/retailer.rb:34:in <top (required)>' from /home/cwatson/.rvm/gems/ruby-1.9.2-p180/gems/padrino-core-0.10.0/lib/padrino-core/reloader.rb:142:inrequire'
from /home/cwatson/.rvm/gems/ruby-1.9.2-p180/gems/padrino-core-0.10.0/lib/padrino-core/reloader.rb:142:in safe_load' from /home/cwatson/.rvm/gems/ruby-1.9.2-p180/gems/padrino-core-0.10.0/lib/padrino-core/loader.rb:140:inblock in require_dependencies'
from /home/cwatson/.rvm/gems/ruby-1.9.2-p180/gems/padrino-core-0.10.0/lib/padrino-core/loader.rb:138:in each' from /home/cwatson/.rvm/gems/ruby-1.9.2-p180/gems/padrino-core-0.10.0/lib/padrino-core/loader.rb:138:inrequire_dependencies'
from /home/cwatson/.rvm/gems/ruby-1.9.2-p180/gems/padrino-core-0.10.0/lib/padrino-core/loader.rb:56:in block in load!' from /home/cwatson/.rvm/gems/ruby-1.9.2-p180/gems/padrino-core-0.10.0/lib/padrino-core/loader.rb:56:ineach'
from /home/cwatson/.rvm/gems/ruby-1.9.2-p180/gems/padrino-core-0.10.0/lib/padrino-core/loader.rb:56:in load!' from /media/scratch/dev/cc/config/boot.rb:42:in<top (required)>'
from /home/cwatson/.rvm/gems/ruby-1.9.2-p180/gems/padrino-core-0.10.0/lib/padrino-core/cli/base.rb:23:in require' from /home/cwatson/.rvm/gems/ruby-1.9.2-p180/gems/padrino-core-0.10.0/lib/padrino-core/cli/base.rb:23:instart'
from /home/cwatson/.rvm/gems/ruby-1.9.2-p180/gems/thor-0.14.6/lib/thor/task.rb:22:in run' from /home/cwatson/.rvm/gems/ruby-1.9.2-p180/gems/thor-0.14.6/lib/thor/invocation.rb:118:ininvoke_task'
from /home/cwatson/.rvm/gems/ruby-1.9.2-p180/gems/thor-0.14.6/lib/thor.rb:263:in dispatch' from /home/cwatson/.rvm/gems/ruby-1.9.2-p180/gems/thor-0.14.6/lib/thor/invocation.rb:109:ininvoke'
from /home/cwatson/.rvm/gems/ruby-1.9.2-p180/gems/padrino-core-0.10.0/lib/padrino-core/cli/base.rb:29:in s' from /home/cwatson/.rvm/gems/ruby-1.9.2-p180/gems/thor-0.14.6/lib/thor/task.rb:22:inrun'
from /home/cwatson/.rvm/gems/ruby-1.9.2-p180/gems/thor-0.14.6/lib/thor/invocation.rb:118:in invoke_task' from /home/cwatson/.rvm/gems/ruby-1.9.2-p180/gems/thor-0.14.6/lib/thor.rb:263:indispatch'
from /home/cwatson/.rvm/gems/ruby-1.9.2-p180/gems/thor-0.14.6/lib/thor/base.rb:389:in start' from /home/cwatson/.rvm/gems/ruby-1.9.2-p180/gems/padrino-core-0.10.0/bin/padrino:9:in<top (required)>'
from /home/cwatson/.rvm/gems/ruby-1.9.2-p180/bin/padrino:19:in load' from /home/cwatson/.rvm/gems/ruby-1.9.2-p180/bin/padrino:19:in

'`

@solnic

solnic Jul 17, 2011

Contributor

Oh sorry that was just a mistake in the example.

+ include DataMapper::Resource
- gem 'carrierwave-datamapper', :require => 'carrierwave/datamapper'
+ property :id, Serial
+
+ mount_uploader :source, ImageUploader
+ end
This used to be part of CarrierWave but has been extracted.

0 comments on commit e18d9b7

Please sign in to comment.