From 3502e6ed7c7a720e6b4d358d9ff7b3242e52a36f Mon Sep 17 00:00:00 2001 From: claudiob Date: Mon, 8 Dec 2014 13:02:29 -0800 Subject: Remove unused "Developer" fixtures from tests The `RecursiveCallbackDeveloper` and `ImmutableMethodDeveloper` classes are not used anymore in tests, and neither is the `@cancelled` variable. --- activerecord/test/cases/callbacks_test.rb | 46 ------------------------------- 1 file changed, 46 deletions(-) diff --git a/activerecord/test/cases/callbacks_test.rb b/activerecord/test/cases/callbacks_test.rb index e3c3c2fcdf..d4cc081f32 100644 --- a/activerecord/test/cases/callbacks_test.rb +++ b/activerecord/test/cases/callbacks_test.rb @@ -59,27 +59,6 @@ class ChildDeveloper < ParentDeveloper end -class RecursiveCallbackDeveloper < ActiveRecord::Base - self.table_name = 'developers' - - before_save :on_before_save - after_save :on_after_save - - attr_reader :on_before_save_called, :on_after_save_called - - def on_before_save - @on_before_save_called ||= 0 - @on_before_save_called += 1 - save unless @on_before_save_called > 1 - end - - def on_after_save - @on_after_save_called ||= 0 - @on_after_save_called += 1 - save unless @on_after_save_called > 1 - end -end - class ImmutableDeveloper < ActiveRecord::Base self.table_name = 'developers' @@ -88,37 +67,12 @@ class ImmutableDeveloper < ActiveRecord::Base before_save :cancel before_destroy :cancel - def cancelled? - @cancelled == true - end - private def cancel - @cancelled = true false end end -class ImmutableMethodDeveloper < ActiveRecord::Base - self.table_name = 'developers' - - validates_inclusion_of :salary, :in => 50000..200000 - - def cancelled? - @cancelled == true - end - - before_save do - @cancelled = true - false - end - - before_destroy do - @cancelled = true - false - end -end - class OnCallbacksDeveloper < ActiveRecord::Base self.table_name = 'developers' -- cgit v1.2.3