Class: PaperTrailScrapbook::Versions Private
- Inherits:
-
Object
- Object
- PaperTrailScrapbook::Versions
- Defined in:
- lib/paper_trail_scrapbook/versions.rb
Overview
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.
Fetches available versions and related version info Provides filtering
Instance Method Summary collapse
- #filtered(object_versions) ⇒ Object private
- #related_content ⇒ Object private
- #versions ⇒ Object private
Instance Method Details
#filtered(object_versions) ⇒ 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.
19 20 21 22 23 |
# File 'lib/paper_trail_scrapbook/versions.rb', line 19 def filtered(object_versions) return object_versions unless object.respond_to?(:version_filter) object_versions.select { |v| object.version_filter(v) } end |
#related_content ⇒ 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.
13 14 15 16 17 |
# File 'lib/paper_trail_scrapbook/versions.rb', line 13 def return [] unless object.respond_to?(:trailed_related_content) object..compact.flat_map(&:versions) end |
#versions ⇒ 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.
9 10 11 |
# File 'lib/paper_trail_scrapbook/versions.rb', line 9 def versions filtered(object.versions | ).sort_by(&:created_at) end |