Sha256: cb423c1c371143c397f487434b9d9b53fe4285e649fc7d6253d542f8c6f7afc8

Contents?: true

Size: 356 Bytes

Versions: 33

Compression:

Stored size: 356 Bytes

Contents

# frozen_string_literal: true

# Shared methods for polymorphic classes
module PolymorphicHelper
  def raise_extract_wrapper_error(invalid_klass)
    raise StoreModel::Types::ExpandWrapperError,
          "#{invalid_klass.inspect} is an invalid model klass"
  end

  def implements_model?(klass)
    klass&.ancestors&.include?(StoreModel::Model)
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
store_model-4.2.0 lib/store_model/types/polymorphic_helper.rb
store_model-4.1.0 lib/store_model/types/polymorphic_helper.rb
store_model-4.0.0 lib/store_model/types/polymorphic_helper.rb
store_model-3.0.2 lib/store_model/types/polymorphic_helper.rb
store_model-3.0.1 lib/store_model/types/polymorphic_helper.rb
store_model-3.0.0 lib/store_model/types/polymorphic_helper.rb
store_model-2.4.0 lib/store_model/types/polymorphic_helper.rb
store_model-2.3.0 lib/store_model/types/polymorphic_helper.rb
store_model-2.2.0 lib/store_model/types/polymorphic_helper.rb
store_model-2.1.2 lib/store_model/types/polymorphic_helper.rb
store_model-2.1.1 lib/store_model/types/polymorphic_helper.rb
store_model-2.1.0 lib/store_model/types/polymorphic_helper.rb
store_model-2.0.1 lib/store_model/types/polymorphic_helper.rb
store_model-2.0.0 lib/store_model/types/polymorphic_helper.rb
store_model-1.6.2 lib/store_model/types/polymorphic_helper.rb
store_model-1.6.1 lib/store_model/types/polymorphic_helper.rb
store_model-1.6.0 lib/store_model/types/polymorphic_helper.rb
store_model-1.5.1 lib/store_model/types/polymorphic_helper.rb
store_model-1.5.0 lib/store_model/types/polymorphic_helper.rb
store_model-1.4.0 lib/store_model/types/polymorphic_helper.rb