Skip to content

Commit

Permalink
Fixed specs
Browse files Browse the repository at this point in the history
  • Loading branch information
kladaFOX committed Sep 3, 2024
1 parent 785cb6c commit 31f09bd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/spectre/searchable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module Spectre
module Searchable
def self.included(base)
unless base.ancestors.include?(Mongoid::Document)
unless base.ancestors.map(&:to_s).include?('Mongoid::Document')
raise "Spectre::Searchable can only be included in Mongoid models. The class #{base.name} does not appear to be a Mongoid model."
end

Expand Down
5 changes: 5 additions & 0 deletions spec/support/mongoid/document.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

module Mongoid
module Document; end
end
2 changes: 2 additions & 0 deletions spec/support/test_model.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# frozen_string_literal: true

require 'spectre'
require_relative 'mongoid/document'

class TestModel
include Spectre
include Mongoid::Document

spectre :embeddable, :searchable

Expand Down

0 comments on commit 31f09bd

Please sign in to comment.