开发者

rails3 - Model Naming Suggestion

开发者 https://www.devze.com 2023-01-29 00:23 出处:网络
I\'m getting ready to add notification settings to my app. Allowing a user to select true/false, for which type of activities they want notifications for.

I'm getting ready to add notification settings to my app. Allowing a user to select true/false, for which type of activities they want notifications for.

My idea for a model is: UserSettingsNotifications. I picked UserSettings, as it's tied to the User, and the user will have several setting types including notifications and others.

Something like:

rails generate model UserSettingNotifications CommentReply:boolean .....

What do you think? Good to go, or not- rails fri开发者_如何学Cendly?


You phrased it "notification settings". I suggest dropping the user prefix and naming it NotificationSettings since it's likely clear in the model it belongs_to :user

0

精彩评论

暂无评论...
验证码 换一张
取 消