Ruby on Rails Thursday, January 31, 2019

rails complains :name is blank and so the record is invalid


p=Picture.first
p
=>2.3.3 :014 > p
 => #<Picture id: 2, comment: "Henry McCarty", imageable_id: 1, imageable_type: "Photo", content_type: nil, created_at: "2018-09-20 02:08:02", updated_at: "2018-10-25 13:41:24", name: "Billy_the_Kid_Ferrotype.jpg", designation: nil, blog_id: nil, caption: "Unretouched original ferrotype of Bonney c. 1880", details: "Henry McCarty", copyright_claim: false, source_page: nil, slug: nil> 
2.3.3 :017 > p.id
 => 2 
2.3.3 :018 > p.comment
 => "Henry McCarty" 
2.3.3 :019 > p.name
 => #<PictureUploader:0x00564c8171dd00 @model=#<Picture id: 2, comment: "Henry McCarty", imageable_id: 1, imageable_type: "Photo", content_type: nil, created_at: "2018-09-20 02:08:02", updated_at: "2018-10-25 13:41:24", name: "Billy_the_Kid_Ferrotype.jpg", designation: nil, blog_id: nil, caption: "Unretouched original ferrotype of Bonney c. 1880", details: "Henry McCarty", copyright_claim: false, source_page: nil, slug: nil>, @mounted_as=:name, @storage=#<CarrierWave::Storage::File:0x00564c8171d710 @uploader=#<PictureUploader:0x00564c8171dd00 ...>>, @file=#<CarrierWave::SanitizedFile:0x00564c8171d288 @file="/home/fugee/data/websites/thekidslepthere/public/images/Billy_the_Kid_Ferrotype.jpg", @original_filename=nil, @content_type=nil>, @versions={:thumb=>#<PictureUploader::Uploader47443268402420:0x00564c8171d238 @model=#<Picture id: 2, comment: "Henry McCarty", imageable_id: 1, imageable_type: "Photo", content_type: nil, created_at: "2018-09-20 02:08:02", updated_at: "2018-10-25 13:41:24", name: "Billy_the_Kid_Ferrotype.jpg", designation: nil, blog_id: nil, caption: "Unretouched original ferrotype of Bonney c. 1880", details: "Henry McCarty", copyright_claim: false, source_page: nil, slug: nil>, @mounted_as=:name, @parent_version=#<PictureUploader:0x00564c8171dd00 ...>, @storage=#<CarrierWave::Storage::File:0x00564c8171d198 @uploader=#<PictureUploader::Uploader47443268402420:0x00564c8171d238 ...>>, @file=#<CarrierWave::SanitizedFile:0x00564c8171cce8 @file="/home/fugee/data/websites/thekidslepthere/public/images/thumb_Billy_the_Kid_Ferrotype.jpg", @original_filename=nil, @content_type=nil>, @versions={}>}>

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/568eab6e-91ea-43a3-9b8d-06e809a94319%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment