#20 √ wontfix
Clemens

Minor inconsistence with column names

Reported by Clemens | June 27th, 2008 @ 10:05 AM

I have a small suggestion regarding the names of Paperclip's column names.

It so happens that I have a model named Attachment in my application because each Entry has_many :attachments. Now, whichever way I put it, it looks kinda awkward:

class Attachment < ActiveRecord::Base
  has_attached_file :attachment
end

When following conventions, this gives me @attachment.attachment.

class Attachment < ActiveRecord::Base
  has_attached_file :file
end

@attachment.file looks good - but @attachment.file_file_size doesn't (and neither does @attachment.file_file_name).

Just for better naming, I'd suggest removing the "file" in both cases. This would give us @attachment.file_size and @attachment.file_name. Plus, it would be more consistent, giving that the third column doesn't contain the word "file".

As I said - nothing major, but it might increase readability.

Comments and changes to this ticket

  • Clemens

    Clemens June 27th, 2008 @ 10:32 AM

    Here's a patch that replaces all occurrences of both columns (including, of course, tests and documentation).

  • Jon Yurek

    Jon Yurek July 25th, 2008 @ 11:22 AM

      • → State changed from “new” to “wontfix”

    While the naming of that set of columns is a little awkward, I would rather keep the convention as it is. The column names aren't terribly visible anyway.

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Attachments

People watching this ticket