Module: Formol::Integration::User::InstanceMethods
- Defined in:
- lib/formol/integration/user.rb
Instance Method Summary collapse
- #has_read_forum?(forum) ⇒ Boolean
- #has_read_topic?(topic) ⇒ Boolean
- #has_subscribed_to?(topic) ⇒ Boolean
-
#preference_with_auto_allocate ⇒ Object
always return a preference object to avoid nil preference has all values defaulted for fallback behavior.
Instance Method Details
#has_read_forum?(forum) ⇒ Boolean
48 49 50 |
# File 'lib/formol/integration/user.rb', line 48 def has_read_forum?(forum) !unread_forums.include?(forum.id) end |
#has_read_topic?(topic) ⇒ Boolean
44 45 46 |
# File 'lib/formol/integration/user.rb', line 44 def has_read_topic?(topic) !unread_topics(topic.forum_id).include?(topic.id) end |
#has_subscribed_to?(topic) ⇒ Boolean
52 53 54 |
# File 'lib/formol/integration/user.rb', line 52 def has_subscribed_to?(topic) subscribed_topic_ids.include?(topic.id) end |
#preference_with_auto_allocate ⇒ Object
always return a preference object to avoid nil preference has all values defaulted for fallback behavior
33 34 35 36 37 38 39 40 41 42 |
# File 'lib/formol/integration/user.rb', line 33 def preference_with_auto_allocate p = preference_without_auto_allocate if p.nil? p = build_preference p.save end p end |