diff --git a/.gitignore b/.gitignore index 3a3540d..9aca51c 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ test/dummy/db/*.sqlite3 test/dummy/log/*.log test/dummy/tmp/ test/dummy/.sass-cache +# rubymine project ignore# +.idea diff --git a/app/controllers/bcms_kcfinder/browse_controller.rb b/app/controllers/bcms_kcfinder/browse_controller.rb index af80ec9..ec482fa 100644 --- a/app/controllers/bcms_kcfinder/browse_controller.rb +++ b/app/controllers/bcms_kcfinder/browse_controller.rb @@ -89,15 +89,13 @@ def list_files end def render_files(files) - paths = Cms::Attachment.find_by_sql("select attachable_id, data_file_path from cms_attachments a where a.attachable_type = 'Cms::AbstractFileBlock'").inject(Hash.new()){|h,v| h[v.attachable_id] = v.data_file_path; h} files.map do |file| { # Handle having a possibly 'null' data_file_name, which might happen if upgrades aren't successful. # Otherwise, the UI can't sort items correctly name: file.name ? file.name : "", - size: file.size_in_bytes, - path: file.is_a?(Cms::Attachment) || file.is_a?(Cms::AbstractFileBlock) ? paths[file.id] : file.path, + path: file.link_to_path, mtime: file.updated_at.to_i, date: file.created_at.strftime("%m/%d/%Y %I:%M %p"), readable: true,