jackdempsey (owner)

Revisions

gist: 225842 Download_button fork
public
Public Clone URL: git://gist.github.com/225842.git
Embed All Files: show embed
easy settings #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class User < ActiveRecord::Base; end
 
user.settings.notify_on.new_post = true
user.settings.notify_on.new_comment = false
user.settings.email_type = :html
 
class Event < ActiveRecord::Base; end
 
event.settings.has_comments = false
event.settings.show_map = true
 
...etc...
 
Was thinking of forking http://github.com/Squeegy/rails-settings and adding in a polymorphic owner to the settings table. Shouldn't be too hard to write, just hate reinventing the wheel.