Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I was doing my ER diagram for a rails application I'm about to begin with and there I have an entity called Class News so I'd have a model ClassNew but I don't know if I will have problems in the future with the New part or what would be the right way to do this o how should I call the model? since the right thing would be ClassNews and the table should be class_news...

What's the best thing to do when working with News at the time of creating models for ActiveRecord in Ruby on Rails.

Thanks.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Why would the model be called "ClassNew" ? "News" is an uncountable noun. If RAILS doesn't already have "News" marked as uncountable, you can change the rules.

share|improve this answer
    
So, before running the migrations and generating the model, I could do rails g model class_news title description and AR will generate ClassNews model using class_news table and I'll be able to use without a problem if its marked as uncountable in Rails? –  Mr_Nizzle Jul 20 '12 at 16:45
    
@Mr_Nizzle: If you are currently getting "ClassNew" from "class_news", instead of "ClassNews", then changing the rules to mark "News" as uncountable (like "fish") should fix that problem. –  kevin cline Jul 20 '12 at 18:45
    
Thanks, ran the model generator with ClassNews and it generated the model ClassNews and the migration creates the table class_news and it works fine in the application like: ClassNews.new and ClassNew.all, seems like it won't mean any trouble. –  Mr_Nizzle Jul 20 '12 at 20:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.