How to implement a singleton model

后端 未结 13 1362
余生分开走
余生分开走 2020-12-24 12:36

I have a site in rails and want to have site-wide settings. One part of my app can notify the admin by SMS if a specific event happens. This is an example of a feature that

13条回答
  •  执笔经年
    2020-12-24 12:42

    I know this is an old thread, but I just needed the same thing and found out that there's a gem for this: acts_as_singleton.

    Installation instructions are for Rails 2, but it works great with Rails 3 too.

提交回复
热议问题