Class: Pageflow::CommentThread Private
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Pageflow::CommentThread
- Includes:
- RevisionComponent
- Defined in:
- app/models/pageflow/comment_thread.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Class Method Summary collapse
- .migrate_to_subject(revision:, subject_type:, subject_id:, thread_ids:) ⇒ Object private
- .update_section_perma_id_for(revision:, subject_type:, subject_id:, section_perma_id:) ⇒ Object private
- .update_subject_ranges_for(revision:, subject_type:, subject_id:, ranges:) ⇒ Object private
Instance Method Summary collapse
- #resolve(user) ⇒ Object private
- #unresolve ⇒ Object private
Methods included from RevisionComponent
#entry_for_auto_generated_perma_id
Methods included from AutoGeneratedPermaId
#ensure_perma_id, #entry_for_auto_generated_perma_id
Class Method Details
.migrate_to_subject(revision:, subject_type:, subject_id:, thread_ids:) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
26 27 28 29 30 31 32 |
# File 'app/models/pageflow/comment_thread.rb', line 26 def self.migrate_to_subject(revision:, subject_type:, subject_id:, thread_ids:) return if thread_ids.blank? where(revision_id: revision.id, subject_type:, id: thread_ids).update_all(subject_id:, updated_at: Time.current) end |
.update_section_perma_id_for(revision:, subject_type:, subject_id:, section_perma_id:) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
47 48 49 50 51 52 53 54 55 |
# File 'app/models/pageflow/comment_thread.rb', line 47 def self.update_section_perma_id_for(revision:, subject_type:, subject_id:, section_perma_id:) return if subject_id.blank? where(revision_id: revision.id, subject_type:, subject_id:) .where.not(section_perma_id:) .update_all(section_perma_id:, updated_at: Time.current) end |
.update_subject_ranges_for(revision:, subject_type:, subject_id:, ranges:) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'app/models/pageflow/comment_thread.rb', line 34 def self.update_subject_ranges_for(revision:, subject_type:, subject_id:, ranges:) return if ranges.blank? where(revision_id: revision.id, subject_type:, subject_id:, id: ranges.keys).update_all( sanitize_sql_array( ["subject_range = #{subject_range_case_sql(ranges)}, updated_at = ?", Time.current] ) ) end |
Instance Method Details
#resolve(user) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
18 19 20 |
# File 'app/models/pageflow/comment_thread.rb', line 18 def resolve(user) update!(resolved_at: Time.current, resolver: user) unless resolved_at end |
#unresolve ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
22 23 24 |
# File 'app/models/pageflow/comment_thread.rb', line 22 def unresolve update!(resolved_at: nil, resolver: nil) end |