Class: TopicStatusUpdater
- Inherits:
-
Struct
- Object
- Struct
- TopicStatusUpdater
- Defined in:
- app/services/topic_status_updater.rb
Defined Under Namespace
Classes: Status
Instance Attribute Summary collapse
-
#topic ⇒ Object
Returns the value of attribute topic.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
Instance Attribute Details
#topic ⇒ Object
Returns the value of attribute topic
3 4 5 |
# File 'app/services/topic_status_updater.rb', line 3 def topic @topic end |
#user ⇒ Object
Returns the value of attribute user
3 4 5 |
# File 'app/services/topic_status_updater.rb', line 3 def user @user end |
Instance Method Details
#update!(status, enabled, opts = {}) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/services/topic_status_updater.rb', line 5 def update!(status, enabled, opts = {}) status = Status.new(status, enabled) @topic_timer = topic.public_topic_timer updated = nil Topic.transaction do updated = change(status, opts) if updated highest_post_number = topic.highest_post_number create_moderator_post_for(status, opts) update_read_state_for( status, highest_post_number, silent_tracking: opts[:silent_tracking], ) end end updated end |