Naming model attributes using _id

Is it a good idea to name some model attributes (and table columns) by
prefixing _id to it?
For example, an application will collect some transaction ID.
transaction_id would be a good name for it, but it will not be
associated to any other table. What kind of bad doodoo would this cause?

Hello,

As long as it’s not used in any model relationships i don’t see any
trouble it could cause.

On Feb 25, 7:08 pm, Greg L. [email protected] wrote:

Is it a good idea to name some model attributes (and table columns) by
prefixing _id to it?
For example, an application will collect some transaction ID.
transaction_id would be a good name for it, but it will not be
associated to any other table. What kind of bad doodoo would this cause?

Posted viahttp://www.ruby-forum.com/.

I can’t think of any problems this would cause, but it will likely
confuse the heck out of the next developer on the project…

–Matt J.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs