Class: Stratagem::Instrumentation::Models::Persistence::FriendlyId::Detect

Inherits:
Detect
  • Object
show all
Defined in:
lib/stratagem/instrumentation/models/support_libraries/friendly_id/detect.rb

Class Method Summary collapse

Class Method Details

.supports?(model) ⇒ Boolean

Returns:

  • (Boolean)


3
4
5
6
7
8
9
10
# File 'lib/stratagem/instrumentation/models/support_libraries/friendly_id/detect.rb', line 3

def self.supports?(model)
  begin
    model.ancestors.include?(FriendlyId::ActiveRecordAdapter::SluggedModel) ||
      model.ancestors.include?(FriendlyId::ActiveRecordAdapter::SimpleModel) 
  rescue
    false
  end
end