We use
- Rails 2.3.8
- Ruby 1.9.2
- Mongo mapper 0.8.6
- Joint 0.5.5
- Wand 0.4
We are getting this error when using etag in this following line of code:
return if fresh_when( :etag => @lesson.video.etag, :last_modified => @lesson.updated_at.utc )
===
Processing LessonsController#video to mp4 (for 127.0.0.1 at 2011-12-22 20:32:51) [GET]
Parameters: {"subdomains"=>["www"], "controller"=>"lessons", "action"=>"video", "id"=>"4ccf79526905582045000041", "format"=>"mp4"}
NoMethodError (undefined method `etag' for #<GridIO _id: 4ccf846a1204cc1b2f0000e9>):
joint (0.5.5) lib/joint/attachment_proxy.rb:32:in `method_missing'
app/controllers/lessons_controller.rb:71:in `video'
Here is the Lesson class:
class Lesson
include MongoMapper::Document
plugin Joint
(other stuff...)
attachment :image
attachment :video
timestamps!
end
Any help would be appreciated.
-Mei
Mei, please use the hash [] method to get the etag attribute:
@lesson.video['etag']