File tree Expand file tree Collapse file tree 4 files changed +5
-5
lines changed Expand file tree Collapse file tree 4 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 11class Cms ::AttachmentsController < Cms ::BaseController
22 def show
3- @attachment = Attachment . find ( params [ :id ] )
3+ @attachment = :: Attachment . find ( params [ :id ] )
44 @attachment = @attachment . as_of_version ( params [ :version ] ) if params [ :version ]
55 send_file ( @attachment . full_file_location ,
66 :filename => @attachment . file_name ,
Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ def try_to_stream_file
102102 unless ext . blank?
103103
104104 #Check access to file
105- @attachment = Attachment . find_live_by_file_path ( @path )
105+ @attachment = :: Attachment . find_live_by_file_path ( @path )
106106 if @attachment
107107 raise Cms ::Errors ::AccessDenied unless current_user . able_to_view? ( @attachment )
108108
Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ def self.storage_location=(storage_location)
144144 end
145145
146146 def self . find_live_by_file_path ( file_path )
147- Attachment . published . not_archived . first ( :conditions => { :file_path => file_path } )
147+ self . published . not_archived . first ( :conditions => { :file_path => file_path } )
148148 end
149149
150150 #----- Instance Methods ------------------------------------------------------
@@ -180,7 +180,7 @@ def public?
180180 end
181181
182182 def full_file_location
183- File . join ( Attachment . storage_location , file_location )
183+ File . join ( self . class . storage_location , file_location )
184184 end
185185
186186 # Forces this record to be changed, even if nothing has changed
Original file line number Diff line number Diff line change @@ -159,7 +159,7 @@ def file_size
159159
160160 def after_as_of_version
161161 if attachment_id && attachment_version
162- self . attachment = Attachment . find ( attachment_id ) . as_of_version ( attachment_version )
162+ self . attachment = :: Attachment . find ( attachment_id ) . as_of_version ( attachment_version )
163163 end
164164 end
165165
You can’t perform that action at this time.
0 commit comments