class Wallaby::Configuration::Models

@deprecated will move this configuration to {Wallaby::ResourcesController} from 6.2 Models configuration to specify the model classes that Wallaby should handle.

Public Instance Methods

exclude(*models) click to toggle source

@note If models are whitelisted using {#set}, models exclusion will NOT be applied. To globally configure what model classes to exclude. @example To exclude models in `config/initializers/wallaby.rb`

Wallaby.config do |config|
  config.models.exclude Product, Order
end

@param models [Array<Class, String>]

# File lib/wallaby/configuration/models.rb, line 31
def exclude(*models)
  @excludes = ClassArray.new(models.flatten)
end
excludes() click to toggle source

@return [Array<Class>] the list of models to exclude.

By default, `ActiveRecord::SchemaMigration` is excluded.
# File lib/wallaby/configuration/models.rb, line 37
def excludes
  @excludes ||= ClassArray.new ['ActiveRecord::SchemaMigration']
end
presence() click to toggle source

@return [Array<Class>] the models configured

# File lib/wallaby/configuration/models.rb, line 20
def presence
  @models ||= ClassArray.new # rubocop:disable Naming/MemoizedInstanceVariableName
end
set(*models) click to toggle source

@note If models are whitelisted, models exclusion will NOT be applied. To globally configure what model classes that Wallaby should handle. @example To whitelist the model classes in `config/initializers/wallaby.rb`

Wallaby.config do |config|
  config.models = [Product, Order]
end

@param models [Array<Class, String>]

# File lib/wallaby/configuration/models.rb, line 15
def set(*models)
  @models = ClassArray.new(models.flatten)
end