Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any reason to avoid word "type" in Rails using Mongoid?

I know type is a magic field name with ActiveRecord for use in Single Table Inheritance. But :type is not included in Mongoid.destructive_fields. Is there any reason I can't use it as a field name? Upload.upload_type feels so ackward and I'd much prefer to use Upload.type.

Furthermore class, category, and variety don't seem like good alternatives.

like image 921
Reed G. Law Avatar asked Jan 01 '26 00:01

Reed G. Law


1 Answers

I am using it without any problems so far. So unless I run into any issues down the road I'm going to answer no, there's no reason to avoid using the word "type".

like image 82
Reed G. Law Avatar answered Jan 02 '26 12:01

Reed G. Law



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!