Class: PaperTrail::Queries::Versions::WhereObjectChangesFrom Private
- Inherits:
-
Object
- Object
- PaperTrail::Queries::Versions::WhereObjectChangesFrom
- Defined in:
- lib/paper_trail/queries/versions/where_object_changes_from.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.
For public API documentation, see ‘where_object_changes_from` in `paper_trail/version_concern.rb`.
Instance Method Summary collapse
- #execute ⇒ Object private
-
#initialize(version_model_class, attributes) ⇒ WhereObjectChangesFrom
constructor
private
-
version_model_class - The class that VersionConcern was mixed into.
-
Constructor Details
#initialize(version_model_class, attributes) ⇒ WhereObjectChangesFrom
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.
-
version_model_class - The class that VersionConcern was mixed into.
-
attributes - A ‘Hash` of attributes and values. See the public API documentation for details.
14 15 16 17 |
# File 'lib/paper_trail/queries/versions/where_object_changes_from.rb', line 14 def initialize(version_model_class, attributes) @version_model_class = version_model_class @attributes = attributes end |
Instance Method Details
#execute ⇒ 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.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/paper_trail/queries/versions/where_object_changes_from.rb', line 20 def execute if PaperTrail.config.object_changes_adapter.respond_to?(:where_object_changes_from) return PaperTrail.config.object_changes_adapter.where_object_changes_from( @version_model_class, @attributes ) end column_type = @version_model_class.columns_hash["object_changes"].type case column_type when :jsonb, :json json else raise UnsupportedColumnType.new( method: "where_object_changes_from", expected: "json or jsonb", actual: column_type ) end end |