Ruby/Rails - Models Named with Two Words (Naming Convention Issues)

后端 未结 4 764
青春惊慌失措
青春惊慌失措 2020-12-23 16:44

This is really a question about naming conventions.

I have a model called PromotedEvents

The file is called promoted_events.rb

I created the table wi

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-23 17:40

    If you are an extreme rails n00b like me, then you will want to remember to create a class definition for your newly created table and place it in app/models.

    It would go like

    class LargeCat < ActiveRecord::Base
        belongs_to :zoo
    end
    

提交回复
热议问题