Class: Thredded::UserMessageboardPreference

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/thredded/user_messageboard_preference.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.in(messageboard) ⇒ Object



21
22
23
# File 'app/models/thredded/user_messageboard_preference.rb', line 21

def self.in(messageboard)
  find_or_initialize_by(messageboard_id: messageboard.id)
end

Instance Method Details

#user=(value) ⇒ Object



34
35
36
37
# File 'app/models/thredded/user_messageboard_preference.rb', line 34

def user=(value)
  super
  set_auto_follow_from_user_preference
end

#user_id=(value) ⇒ Object



29
30
31
32
# File 'app/models/thredded/user_messageboard_preference.rb', line 29

def user_id=(value)
  super
  set_auto_follow_from_user_preference
end

#user_preferenceObject



25
26
27
# File 'app/models/thredded/user_messageboard_preference.rb', line 25

def user_preference
  super || build_user_preference
end