class TestFriendly::Global

Public Class Methods

add_model(model) click to toggle source
# File lib/global.rb, line 4
def self.add_model(model)
  @models ||= []
  @models << model
  @models.uniq!
end
callbacks_on?() click to toggle source
# File lib/global.rb, line 38
def self.callbacks_on?
  Rails.env != 'test'
end
drop_callbacks(tag = :defaults) click to toggle source
# File lib/global.rb, line 31
def self.drop_callbacks(tag = :defaults)
  @models ||= []
  @models.each do |model|
    model.drop_callbacks(tag)
  end      
end
drop_validations(tag = :defaults) click to toggle source
# File lib/global.rb, line 24
def self.drop_validations(tag = :defaults)
  @models ||= []
  @models.each do |model|
    model.drop_validations(tag)
  end
end
force_callbacks(tag = :defaults) click to toggle source
# File lib/global.rb, line 17
def self.force_callbacks(tag = :defaults)
  @models ||= []      
  @models.each do |model|
    model.force_callbacks(tag)
  end
end
force_validations(tag = :defaults) click to toggle source
# File lib/global.rb, line 10
def self.force_validations(tag = :defaults)
  @models ||= []      
  @models.each do |model|
    model.force_validations(tag)
  end
end