title: How to seed a photo in rails
body: <p>I am using paperclip, but not sure how to seed with/without it.</p>
  
  <p>I have a placeholder, in my local path (OSX) as <code>/Users/me/dev/APP/doc/seeding/300x220.jpg</code></p>
  
  <p>My seed file is:</p>
  
  <pre><code>p = Photo.new({:description =&gt; 'one', :created_at =&gt; "Sun, 1 Jan 2012 01:01:01 -0500".to_datetime, :updated_at =&gt; "Sun, 1 Jan 2012 01:01:01 -0500".to_datetime })
  p.image_file_name = File.open(Rails.root.join('doc', 'seeding', '300x220.jpg'))
  p.save!
  </code></pre>
  
  <p>My error is returning:</p>
  
  <pre><code>No such file or directory - /Users/me/dev/APP/doc/seeding/300x220.jpg
  /Users/me/dev/APP/db/seeds.rb:20:in `initialize'
  /Users/me/dev/APP/db/seeds.rb:20:in `open'
  /Users/me/dev/APP/db/seeds.rb:20:in `&lt;top (required)&gt;'
  /Users/me/.rvm/gems/ruby-1.9.3-p362/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in `load'
  /Users/me/.rvm/gems/ruby-1.9.3-p362/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in `block in load'
  /Users/me/.rvm/gems/ruby-1.9.3-p362/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency'
  /Users/me/.rvm/gems/ruby-1.9.3-p362/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:245:in `load'
  /Users/me/.rvm/gems/ruby-1.9.3-p362/gems/railties-3.2.11/lib/rails/engine.rb:520:in `load_seed'
  /Users/me/.rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.11/lib/active_record/railties/databases.rake:333:in `block (2 levels) in &lt;top (required)&gt;'
  /Users/me/.rvm/gems/ruby-1.9.3-p362/bin/ruby_noexec_wrapper:14:in `eval'
  /Users/me/.rvm/gems/ruby-1.9.3-p362/bin/ruby_noexec_wrapper:14:in `&lt;main&gt;'
  Tasks: TOP =&gt; db:setup =&gt; db:seed =&gt; db:seed:common =&gt; db:seed:original
  </code></pre>
  
  <p><a href="http://rdoc.info/search/gems/paperclip?q=seed" rel="nofollow">Searching the rdoc for paperclip</a>, returns nothing.</p>
  
  <p>Other documents that might be of help:</p>
  
  <p>Schema for Photo:</p>
  
  <pre><code>create_table "photos", :force =&gt; true do |t|
   t.string   "description"
   t.datetime "created_at",         :null =&gt; false
   t.datetime "updated_at",         :null =&gt; false
   t.string   "image_file_name"
   t.string   "image_content_type"
   t.integer  "image_file_size"
   t.datetime "image_updated_at"
  end
  </code></pre>