Class: Stratagem::Instrumentation::Models::Persistence::FriendlyId::Metadata

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

Overview

prefix method names with to avoid collision

Instance Method Summary collapse

Constructor Details

#initialize(model) ⇒ Metadata

Returns a new instance of Metadata.



5
6
7
# File 'lib/stratagem/instrumentation/models/support_libraries/friendly_id/metadata.rb', line 5

def initialize(model)
  @model = model
end

Instance Method Details

#exclude_attributes_for_mockingObject



9
10
11
12
13
14
15
16
17
18
# File 'lib/stratagem/instrumentation/models/support_libraries/friendly_id/metadata.rb', line 9

def exclude_attributes_for_mocking
  # open id
  attrs = @model.stratagem.attribute_names.select {|a|
    (a.to_s =~ /friendly_id/)
  }
  attrs << :friendly_id_config
  attrs << :cached_slug

  attrs.uniq
end