Module: DoNotWant

Defined in:
lib/do_not_want.rb

Defined Under Namespace

Classes: NotSafe

Constant Summary collapse

VERSION =
"0.0.1"
BAD_INSTANCE_METHODS =

Bad methods and their reasons

{
  :decrement => ["callbacks"],
  :decrement! => ["validation"],
  :increment => ["callbacks"],
  :increment! => ["validation"],
  :toggle => ["callbacks"],
  :toggle! => ["validation"],
  :update_attribute => ["validation"],
}
BAD_INSTANCE_METHOD_NAMES =
BAD_INSTANCE_METHODS.keys
BAD_CLASS_METHODS =
{
  :decrement_counter => ["validation", "callbacks"],
  :delete => ["callbacks"],
  :delete_all => ["callbacks"],
  :find_by_sql => ["callbacks"],
  :increment_counter => ["validation", "callbacks"],
  :update_all => ["validation", "callbacks"],
  :update_counters => ["validation", "callbacks"],
}
BAD_CLASS_METHOD_NAMES =
BAD_CLASS_METHODS.keys

Class Method Summary collapse

Class Method Details

.should_validate_for_caller(caller) ⇒ Object



45
46
47
# File 'lib/do_not_want.rb', line 45

def self.should_validate_for_caller(caller)
  /\/gems\//.match(caller[0])
end