From: Daniel Waite Date: 2009-01-25T09:19:17+09:00 Subject: Scope resolution operator (The code I will demonstrate is Rails-based, but the question is Ruby-based.) I'm familiar with the following: ActiveRecord::Base Basically says, look inside ActiveRecord for a class or module named Base. But what about the following: ::Attachment Does that basically say, no matter what scope you are in, jump to the highest level to look for the class or module named Attachment? The following code only works when I prefix the Attachment class with :: has_one :attachment, :as => :attachable, :class_name => '::Attachment' def assign_attachment=(attachment_id) self.attachment = ::Attachment.find(attachment_id) end -- Posted via http://www.ruby-forum.com/.