summaryrefslogtreecommitdiffstats
path: root/app/models/attachment.rb
Commit message (Collapse)AuthorAgeFilesLines
* Support for WebP images (#38168).Go MAEDA2023-01-161-1/+1
| | | | | | | | | | | * Inline image * Thumbnail * Inserting markup for an image uploaded by drag and drop Patch by Go MAEDA. git-svn-id: https://svn.redmine.org/redmine/trunk@22045 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Update copyright year to 2023 (#38141).Go MAEDA2023-01-011-1/+1
| | | | git-svn-id: https://svn.redmine.org/redmine/trunk@22013 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Fix RuboCop offense Lint/NonAtomicFileOperation (#36919).Go MAEDA2022-06-301-3/+1
| | | | git-svn-id: https://svn.redmine.org/redmine/trunk@21694 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Attachment activity provider SQL optimization (#37057).Go MAEDA2022-05-141-0/+1
| | | | | | | Patch by Jens Krämer. git-svn-id: https://svn.redmine.org/redmine/trunk@21573 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Update copyright year in source files to 2022 (#36379).Go MAEDA2022-01-021-1/+1
| | | | git-svn-id: http://svn.redmine.org/redmine/trunk@21342 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Fix that binmode specified twice (#35539, #35720).Go MAEDA2021-08-181-1/+1
| | | | | | | Patch by Pavel Rosický. git-svn-id: http://svn.redmine.org/redmine/trunk@21193 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Ensure unique attachment filenames (#35539).Go MAEDA2021-07-191-13/+18
| | | | | | | Patch by Jens Krämer. git-svn-id: http://svn.redmine.org/redmine/trunk@21071 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Validate attachment filenames on every change (#34367).Go MAEDA2021-04-161-6/+5
| | | | | | | Patch by Holger Just. git-svn-id: http://svn.redmine.org/redmine/trunk@20946 e93f8b46-1217-0410-a6f0-8f06a7374b81
* The result of Attachment.latest_attach is unstable if attachments have the ↵Go MAEDA2021-04-071-1/+1
| | | | | | | | | same timestamp (#34999). Patch by Pavel Rosický. git-svn-id: http://svn.redmine.org/redmine/trunk@20923 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Update copyright year in source files to 2021 (#33069).Go MAEDA2021-03-251-1/+1
| | | | git-svn-id: http://svn.redmine.org/redmine/trunk@20846 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Case-insensitive matching fails for Unicode filenames when referring to ↵Go MAEDA2021-03-201-1/+3
| | | | | | | | | attachments in text formatting (#27780). Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@20835 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Introduces an additional check before removing a deduplicated file (#34479).Go MAEDA2021-03-171-5/+4
| | | | | | | Patch by Jens Krämer. git-svn-id: http://svn.redmine.org/redmine/trunk@20812 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Reverts r20654.Go MAEDA2021-03-171-6/+6
| | | | git-svn-id: http://svn.redmine.org/redmine/trunk@20811 e93f8b46-1217-0410-a6f0-8f06a7374b81
* remove redundant 'return' from app/models/attachment.rbToshi MARUYAMA2020-12-191-1/+1
| | | | git-svn-id: http://svn.redmine.org/redmine/trunk@20677 e93f8b46-1217-0410-a6f0-8f06a7374b81
* place the '.' on the previous line of the method call at ↵Toshi MARUYAMA2020-12-171-6/+6
| | | | | | app/models/attachment.rb git-svn-id: http://svn.redmine.org/redmine/trunk@20654 e93f8b46-1217-0410-a6f0-8f06a7374b81
* shorten long line of app/models/attachment.rbToshi MARUYAMA2020-12-091-5/+22
| | | | git-svn-id: http://svn.redmine.org/redmine/trunk@20590 e93f8b46-1217-0410-a6f0-8f06a7374b81
* add empty line after guard clause to app/models/attachment.rbToshi MARUYAMA2020-11-051-0/+1
| | | | git-svn-id: http://svn.redmine.org/redmine/trunk@20265 e93f8b46-1217-0410-a6f0-8f06a7374b81
* shorten long line of app/models/attachment.rbToshi MARUYAMA2020-10-221-20/+30
| | | | git-svn-id: http://svn.redmine.org/redmine/trunk@20158 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Evaluate acts_as_activity_provider's scope lazily (#33664).Go MAEDA2020-10-171-2/+6
| | | | | | | Patch by Pavel Rosický. git-svn-id: http://svn.redmine.org/redmine/trunk@20148 e93f8b46-1217-0410-a6f0-8f06a7374b81
* When creating more than two identical attachments in a single transaction, ↵Go MAEDA2020-09-281-1/+2
| | | | | | | | | the first one always ends up unreadable (#33769). Patch by Jens Krämer. git-svn-id: http://svn.redmine.org/redmine/trunk@20094 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Fix that bulk download raises Errno::EACCES on Windows (#7056).Go MAEDA2020-04-111-5/+8
| | | | | | | Patch by Yuichi HARADA. git-svn-id: http://svn.redmine.org/redmine/trunk@19688 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Replace File#readable? with Attachment#readable? (#7056).Go MAEDA2020-04-011-1/+1
| | | | git-svn-id: http://svn.redmine.org/redmine/trunk@19631 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Download all attachments at once (#7056).Go MAEDA2020-03-211-0/+25
| | | | | | | Patch by Mizuki ISHIKAWA. git-svn-id: http://svn.redmine.org/redmine/trunk@19601 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Update copyright year in source files to 2020 (#33069).Go MAEDA2020-03-031-1/+1
| | | | git-svn-id: http://svn.redmine.org/redmine/trunk@19553 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Don't try to generate thumbnails if convert command is not available (#32289).Go MAEDA2019-10-311-1/+3
| | | | | | | Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@18885 e93f8b46-1217-0410-a6f0-8f06a7374b81
* code cleanup: rubocop: fix Style/WhileUntilModifier in app/models/attachment.rbToshi MARUYAMA2019-10-191-1/+2
| | | | git-svn-id: http://svn.redmine.org/redmine/trunk@18783 e93f8b46-1217-0410-a6f0-8f06a7374b81
* code cleanup: rubocop: fix Lint/IneffectiveAccessModifier in ↵Toshi MARUYAMA2019-10-191-15/+18
| | | | | | app/models/attachment.rb git-svn-id: http://svn.redmine.org/redmine/trunk@18781 e93f8b46-1217-0410-a6f0-8f06a7374b81
* code cleanup: rubocop: fix Layout/IndentationConsistency in ↵Toshi MARUYAMA2019-10-091-8/+8
| | | | | | app/models/attachment.rb git-svn-id: http://svn.redmine.org/redmine/trunk@18640 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Use Redmine::MimeType.of instead of regexp to check if the attachment is ↵Go MAEDA2019-10-031-1/+1
| | | | | | Textile (#29752). git-svn-id: http://svn.redmine.org/redmine/trunk@18586 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Render Textile and Markdown attachments on the preview page (#29752).Go MAEDA2019-10-031-0/+8
| | | | | | | Patch by Takenori TAKAKI. git-svn-id: http://svn.redmine.org/redmine/trunk@18584 e93f8b46-1217-0410-a6f0-8f06a7374b81
* code cleanup: rubocop: fix Layout/EmptyLinesAroundBlockBody in ↵Toshi MARUYAMA2019-09-301-5/+0
| | | | | | app/models/attachment.rb git-svn-id: http://svn.redmine.org/redmine/trunk@18558 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Update copyright year.Go MAEDA2019-05-251-1/+1
| | | | git-svn-id: http://svn.redmine.org/redmine/trunk@18198 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Render PDF thumbnail using ImageMagick/GhostScript (#22481).Go MAEDA2019-05-121-2/+2
| | | | | | | Patch by Gregor Schmidt. git-svn-id: http://svn.redmine.org/redmine/trunk@18158 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Attachment preview does not work for some source files such as JavaScript ↵Go MAEDA2019-05-041-1/+1
| | | | | | | | | and Go (#29259). Patch by Go MAEDA with the help of Stephan Wenzel's contribution. git-svn-id: http://svn.redmine.org/redmine/trunk@18122 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Use Regexp#match? to reduce allocations of MatchData object (#28940).Go MAEDA2019-03-271-2/+2
| | | | | | | Patch by Pavel Rosický. git-svn-id: http://svn.redmine.org/redmine/trunk@18011 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Support frozen_string_literal in app/**/*.rb (#26561).Go MAEDA2019-03-171-1/+1
| | | | | | | Contributed by Pavel Rosický. git-svn-id: http://svn.redmine.org/redmine/trunk@17987 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Add "frozen_string_literal: false" for all files (#26561).Go MAEDA2019-03-151-0/+2
| | | | | | | This will be changed to true in the future. git-svn-id: http://svn.redmine.org/redmine/trunk@17947 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Makes sure the generated thumbnail is always of at least the requested size ↵Go MAEDA2019-02-051-1/+1
| | | | | | | | | (#13688). Patch by Jens Krämer and Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@17850 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Deletes thumbnails when the attachment diskfile is deleted (#30177).Go MAEDA2018-12-151-1/+9
| | | | | | | Patch by Jens Krämer. git-svn-id: http://svn.redmine.org/redmine/trunk@17736 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Allows re-use of thumbnails for identical attachments (#30177).Go MAEDA2018-12-151-1/+1
| | | | | | | Patch by Jens Krämer. git-svn-id: http://svn.redmine.org/redmine/trunk@17735 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Use find_by instead of where.first to remove unnecessary sorting (#26747).Go MAEDA2018-10-061-1/+1
| | | | | | | Patch by Yuichi HARADA. git-svn-id: http://svn.redmine.org/redmine/trunk@17586 e93f8b46-1217-0410-a6f0-8f06a7374b81
* "thumbnail" macro may break filename attribute of the attachment (#29038).Go MAEDA2018-07-021-1/+1
| | | | | | | Patch by Toru Takahashi. git-svn-id: http://svn.redmine.org/redmine/trunk@17428 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Adds previews for audio / video attachments (#27336).Go MAEDA2018-05-171-1/+9
| | | | | | | Patch by Jens Kraemer. git-svn-id: http://svn.redmine.org/redmine/trunk@17340 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Merged rails-5.1 branch (#23630).Jean-Philippe Lang2017-07-231-1/+0
| | | | git-svn-id: http://svn.redmine.org/redmine/trunk@16859 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Update copyright.Jean-Philippe Lang2017-06-251-1/+1
| | | | git-svn-id: http://svn.redmine.org/redmine/trunk@16685 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Preview files by default instead of downloading them (#25988).Jean-Philippe Lang2017-06-101-1/+5
| | | | | | Patch by Jan Schulz-Hofen. git-svn-id: http://svn.redmine.org/redmine/trunk@16651 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Prevent deadlocks by only locking the exact records we need to have locked ↵Jean-Philippe Lang2017-04-131-8/+14
| | | | | | | | (#25590). Patch by Jens Kraemer. git-svn-id: http://svn.redmine.org/redmine/trunk@16541 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Delete the file after the change is committed (#25215).Jean-Philippe Lang2017-04-031-2/+6
| | | | git-svn-id: http://svn.redmine.org/redmine/trunk@16460 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Adds file equality check to deduplication hook (#25215).Jean-Philippe Lang2017-04-031-3/+10
| | | | | | Patch by Jens Kraemer. git-svn-id: http://svn.redmine.org/redmine/trunk@16459 e93f8b46-1217-0410-a6f0-8f06a7374b81
* Reuse existing identical disk files for new attachments (#25215).Jean-Philippe Lang2017-04-031-0/+19
| | | | | | Patch by Jens Kraemer. git-svn-id: http://svn.redmine.org/redmine/trunk@16458 e93f8b46-1217-0410-a6f0-8f06a7374b81