Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

refactoring tests

git-svn-id: https://svn.thoughtbot.com/plugins/when/trunk@309 7bbfaf0e-4d1d-0410-9690-a8bb5f8ef2aa
  • Loading branch information...
commit 25414c52b67485ec5a6e98adc94202ab5cbac63e 1 parent 5e2b551
dcroak authored
2  init.rb
... ... @@ -1 +1 @@
1   -require 'when'
  1 +require File.join(File.dirname(__FILE__), 'lib', 'when')
25 lib/callbacks.rb
@@ -30,18 +30,19 @@ def #{callback}_with_conditions (*callbacks, &block)
30 30 def execute_callback(callback, record, method)
31 31 if callback.class == Symbol
32 32 record.send callback
33   - # elsif callback.class == String
34   - # eval callback, record.send(:binding)
35   - # elsif callback.class == Proc ||
36   - # callback.class == Method
37   - # callback.call record
38   - # else
39   - # if callback.respond_to?(method)
40   - # callback.send method, record
41   - # else
42   - # raise ActiveRecordError,
43   - # 'Callbacks must be a symbol denoting the message to send, a string to be evaluated, a block to be invoked or a class object responding to the callback message (#before_create, #after_create, etc).'
44   - # end
  33 + elsif callback.class == String
  34 + eval callback, record.send(:binding)
  35 + elsif callback.class == Proc || callback.class == Method
  36 + callback.call record
  37 + else
  38 + if callback.respond_to?(method)
  39 + callback.send method, record
  40 + else
  41 + raise ActiveRecordError, 'Callbacks must be a symbol denoting the message to send,
  42 + a string to be evaluated, a block to be invoked or a
  43 + class object responding to the callback message
  44 + (#before_create, #after_create, etc).'
  45 + end
45 46 end
46 47 end
47 48
2  lib/validations.rb
@@ -3,7 +3,7 @@ module Validations
3 3
4 4 def self.included(klass)
5 5 class << klass
6   -
  6 +
7 7 validations = ActiveRecord::Validations::VALIDATIONS
8 8
9 9 validations.each do |validation|
7 lib/when.rb
... ... @@ -1,8 +1,7 @@
1   -require 'callbacks'
2   -require 'validations'
3   -require 'filters'
  1 +require File.join(File.dirname(__FILE__), 'validations')
  2 +require File.join(File.dirname(__FILE__), 'filters')
  3 +require File.join(File.dirname(__FILE__), 'callbacks')
4 4
5 5 ActiveRecord::Base.send :include, ActiveRecordHook::Callbacks
6 6 ActiveRecord::Base.send :include, ActiveRecordHook::Validations
7   -
8 7 ActionController::Base.send :include, ActionControllerHook::Filters
160 test/callbacks_test.rb
... ... @@ -0,0 +1,160 @@
  1 +require File.join(File.dirname(__FILE__), 'test_helper')
  2 +
  3 +class CallbacksTest < Test::Unit::TestCase
  4 +
  5 + def setup
  6 + load File.join(File.dirname(__FILE__), 'fixtures', 'company.rb')
  7 + end
  8 +
  9 + basic_callbacks = ['before_create', 'after_create',
  10 + 'before_validation_on_create', 'before_validation',
  11 + 'after_validation_on_create', 'after_validation',
  12 + 'before_save', 'after_save' ]
  13 +
  14 + destroy_callbacks = ['before_destroy', 'after_destroy']
  15 +
  16 + unique_callbacks = ['after_find', 'after_initialize',
  17 + 'before_update', 'after_update',
  18 + 'before_validation_on_update', 'after_validation_on_update']
  19 +
  20 + conditions = ['lambda {|company| company.callback_flag == true}']
  21 +
  22 + src = ''
  23 +
  24 + conditions.each do |condition|
  25 + basic_callbacks.each do |callback|
  26 + src << <<-END;
  27 + def test_#{callback}_with_if_condition_which_returns_true_should_change_company_name
  28 + Company.class_eval do
  29 + #{callback} :change_name, :if => #{condition}
  30 + end
  31 + company = Company.new :name => 'thoughtbot', :callback_flag => true
  32 + assert company.save
  33 + assert_equal 'new name', company.name
  34 + end
  35 +
  36 + def test_#{callback}_with_if_condition_which_returns_false_should_not_change_company_name
  37 + Company.class_eval do
  38 + #{callback} :change_name, :if => #{condition}
  39 + end
  40 + company = Company.new :name => 'thoughtbot', :callback_flag => false
  41 + assert company.save
  42 + assert_equal 'thoughtbot', company.name
  43 + end
  44 +
  45 + def test_#{callback}_with_unless_condition_which_returns_true_should_not_change_company_name
  46 + Company.class_eval do
  47 + #{callback} :change_name, :unless => #{condition}
  48 + end
  49 + company = Company.new :name => 'thoughtbot', :callback_flag => true
  50 + assert company.save
  51 + assert_equal 'thoughtbot', company.name
  52 + end
  53 +
  54 + def test_#{callback}_with_unless_condition_which_returns_false_should_change_company_name
  55 + Company.class_eval do
  56 + #{callback} :change_name, :unless => #{condition}
  57 + end
  58 + company = Company.new :name => 'thoughtbot', :callback_flag => false
  59 + assert company.save
  60 + assert_equal 'new name', company.name
  61 + end
  62 + END
  63 + end
  64 +
  65 + destroy_callbacks.each do |callback|
  66 + src << <<-END;
  67 + def test_#{callback}_with_if_condition_which_returns_true_should_change_company_name
  68 + Company.class_eval do
  69 + #{callback} :change_name, :if => #{condition}
  70 + end
  71 + company = Company.new :name => 'thoughtbot', :callback_flag => true
  72 + assert company.save
  73 + assert company.destroy
  74 + assert_equal 'new name', company.name unless company.frozen?
  75 + end
  76 +
  77 + def test_#{callback}_with_if_condition_which_returns_false_should_not_change_company_name
  78 + Company.class_eval do
  79 + #{callback} :change_name, :if => #{condition}
  80 + end
  81 + company = Company.new :name => 'thoughtbot', :callback_flag => false
  82 + assert company.save
  83 + assert company.destroy
  84 + assert_equal 'thoughtbot', company.name
  85 + end
  86 +
  87 + def test_#{callback}_with_unless_condition_which_returns_true_should_not_change_company_name
  88 + Company.class_eval do
  89 + #{callback} :change_name, :unless => #{condition}
  90 + end
  91 + company = Company.new :name => 'thoughtbot', :callback_flag => true
  92 + assert company.save
  93 + assert company.destroy
  94 + assert_equal 'thoughtbot', company.name
  95 + end
  96 +
  97 + def test_#{callback}_with_unless_condition_which_returns_false_should_change_company_name
  98 + Company.class_eval do
  99 + #{callback} :change_name, :unless => #{condition}
  100 + end
  101 + company = Company.new :name => 'thoughtbot', :callback_flag => false
  102 + assert company.save
  103 + assert company.destroy
  104 + assert_equal 'new name', company.name unless company.frozen?
  105 + end
  106 + END
  107 + end
  108 +
  109 + src << <<-END;
  110 + def test_after_find_with_if_condition_which_returns_true_should_change_company_name
  111 + Company.class_eval do
  112 + after_find :change_name, :if => #{condition}
  113 + end
  114 + company = Company.new :name => 'thoughtbot', :callback_flag => true
  115 + assert company.save
  116 + company = Company.find company.id
  117 + assert_equal 'new name', company.name
  118 + end
  119 +
  120 + def test_after_find_with_if_condition_which_returns_false_should_not_change_company_name
  121 + Company.class_eval do
  122 + after_find :change_name, :if => #{condition}
  123 + end
  124 + company = Company.new :name => 'thoughtbot', :callback_flag => false
  125 + assert company.save
  126 + company = Company.find company.id
  127 + assert_equal 'thoughtbot', company.name
  128 + end
  129 +
  130 + def test_after_find_with_unless_condition_which_returns_true_should_not_change_company_name
  131 + Company.class_eval do
  132 + after_find :change_name, :unless => #{condition}
  133 + end
  134 + company = Company.new :name => 'thoughtbot', :callback_flag => true
  135 + assert company.save
  136 + company = Company.find company.id
  137 + assert_equal 'thoughtbot', company.name
  138 + end
  139 +
  140 + def test_after_find_with_unless_condition_which_returns_false_should_change_company_name
  141 + Company.class_eval do
  142 + after_find :change_name, :unless => #{condition}
  143 + end
  144 + company = Company.new :name => 'thoughtbot', :callback_flag => false
  145 + assert company.save
  146 + company = Company.find company.id
  147 + assert_equal 'new name', company.name
  148 + end
  149 + END
  150 + end
  151 +
  152 + class_eval src, __FILE__, __LINE__
  153 +
  154 + def teardown
  155 + Object.class_eval do
  156 + remove_const Company.to_s if const_defined? Company.to_s
  157 + end
  158 + end
  159 +
  160 +end
1,836 test/fixtures/company.rb
... ... @@ -1,918 +1,926 @@
1 1 class Company < ActiveRecord::Base
2 2
3   - (1..114).each do |each|
4   - attr_accessor :"attribute_#{each}"
5   - end
6   -
7   - before_create :before_create_if_with_proc_condition,
8   - :if => lambda {|company| company.attribute_1 == 'before_create_if_with_proc_condition'}
9   - before_create :before_create_unless_with_proc_condition,
10   - :unless => lambda {|company| company.attribute_2 == 'before_create_unless_with_proc_condition'}
11   -
12   - def before_create_if_with_proc_condition
13   - self.attribute_1 = 'attribute_1'
14   - end
15   -
16   - def before_create_unless_with_proc_condition
17   - self.attribute_2 = 'attribute_2'
18   - end
19   -
20   - after_create :after_create_if_with_proc_condition,
21   - :if => lambda {|company| company.attribute_3 == 'after_create_if_with_proc_condition'}
22   - after_create :after_create_unless_with_proc_condition,
23   - :unless => lambda {|company| company.attribute_4 == 'after_create_unless_with_proc_condition'}
24   -
25   - def after_create_if_with_proc_condition
26   - self.attribute_3 = 'attribute_3'
27   - end
28   -
29   - def after_create_unless_with_proc_condition
30   - self.attribute_4 = 'attribute_4'
31   - end
32   -
33   - before_save :before_save_if_with_proc_condition,
34   - :if => lambda {|company| company.attribute_5 == 'before_save_if_with_proc_condition'}
35   - before_save :before_save_unless_with_proc_condition,
36   - :unless => lambda {|company| company.attribute_6 == 'before_save_unless_with_proc_condition'}
37   -
38   - def before_save_if_with_proc_condition
39   - self.attribute_5 = 'attribute_5'
40   - end
41   -
42   - def before_save_unless_with_proc_condition
43   - self.attribute_6 = 'attribute_6'
44   - end
45   -
46   - after_save :after_save_if_with_proc_condition,
47   - :if => lambda {|company| company.attribute_7 == 'after_save_if_with_proc_condition'}
48   - after_save :after_save_unless_with_proc_condition,
49   - :unless => lambda {|company| company.attribute_8 == 'after_save_unless_with_proc_condition'}
50   -
51   - def after_save_if_with_proc_condition
52   - self.attribute_7 = 'attribute_7'
53   - end
54   -
55   - def after_save_unless_with_proc_condition
56   - self.attribute_8 = 'attribute_8'
57   - end
58   -
59   - before_destroy :before_destroy_if_with_proc_condition,
60   - :if => lambda {|company| company.attribute_9 == 'before_destroy_if_with_proc_condition'}
61   - before_destroy :before_destroy_unless_with_proc_condition,
62   - :unless => lambda {|company| company.attribute_10 == 'before_destroy_unless_with_proc_condition'}
63   -
64   - def before_destroy_if_with_proc_condition
65   - self.attribute_9 = 'attribute_9'
66   - end
67   -
68   - def before_destroy_unless_with_proc_condition
69   - self.attribute_10 = 'attribute_10'
70   - end
71   -
72   - after_destroy :after_destroy_if_with_proc_condition,
73   - :if => lambda {|company| company.attribute_11 == 'after_destroy_if_with_proc_condition'}
74   - after_destroy :after_destroy_unless_with_proc_condition,
75   - :unless => lambda {|company| company.attribute_12 == 'after_destroy_unless_with_proc_condition'}
76   -
77   - def after_destroy_if_with_proc_condition
78   - self.attribute_11 = 'attribute_11'
79   - end
80   -
81   - def after_destroy_unless_with_proc_condition
82   - self.attribute_12 = 'attribute_12'
83   - end
84   -
85   - before_update :before_update_if_with_proc_condition,
86   - :if => lambda {|company| company.attribute_13 == 'before_update_if_with_proc_condition'}
87   - before_update :before_update_unless_with_proc_condition,
88   - :unless => lambda {|company| company.attribute_14 == 'before_update_unless_with_proc_condition'}
89   -
90   - def before_update_if_with_proc_condition
91   - self.attribute_13 = 'attribute_13'
92   - end
93   -
94   - def before_update_unless_with_proc_condition
95   - self.attribute_14 = 'attribute_14'
96   - end
97   -
98   - after_update :after_update_if_with_proc_condition,
99   - :if => lambda {|company| company.attribute_15 == 'after_update_if_with_proc_condition'}
100   - after_update :after_update_unless_with_proc_condition,
101   - :unless => lambda {|company| company.attribute_16 == 'after_update_unless_with_proc_condition'}
102   -
103   - def after_update_if_with_proc_condition
104   - self.attribute_15 = 'attribute_15'
105   - end
106   -
107   - def after_update_unless_with_proc_condition
108   - self.attribute_16 = 'attribute_16'
109   - end
110   -
111   - before_validation :before_validation_if_with_proc_condition,
112   - :if => lambda {|company| company.attribute_17 == 'before_validation_if_with_proc_condition'}
113   - before_validation :before_validation_unless_with_proc_condition,
114   - :unless => lambda {|company| company.attribute_18 == 'before_validation_unless_with_proc_condition'}
115   -
116   - def before_validation_if_with_proc_condition
117   - self.attribute_17 = 'attribute_17'
118   - end
119   -
120   - def before_validation_unless_with_proc_condition
121   - self.attribute_18 = 'attribute_18'
122   - end
123   -
124   - after_validation :after_validation_if_with_proc_condition,
125   - :if => lambda {|company| company.attribute_19 == 'after_validation_if_with_proc_condition'}
126   - after_validation :after_validation_unless_with_proc_condition,
127   - :unless => lambda {|company| company.attribute_20 == 'after_validation_unless_with_proc_condition'}
128   -
129   - def after_validation_if_with_proc_condition
130   - self.attribute_19 = 'attribute_19'
131   - end
132   -
133   - def after_validation_unless_with_proc_condition
134   - self.attribute_20 = 'attribute_20'
135   - end
136   -
137   - before_validation_on_create :before_validation_on_create_if_with_proc_condition,
138   - :if => lambda {|company| company.attribute_21 == 'before_validation_on_create_if_with_proc_condition'}
139   - before_validation_on_create :before_validation_on_create_unless_with_proc_condition,
140   - :unless => lambda {|company| company.attribute_22 == 'before_validation_on_create_unless_with_proc_condition'}
141   -
142   - def before_validation_on_create_if_with_proc_condition
143   - self.attribute_21 = 'attribute_21'
144   - end
145   -
146   - def before_validation_on_create_unless_with_proc_condition
147   - self.attribute_22 = 'attribute_22'
148   - end
149   -
150   - after_validation_on_create :after_validation_on_create_if_with_proc_condition,
151   - :if => lambda {|company| company.attribute_23 == 'after_validation_on_create_if_with_proc_condition'}
152   - after_validation_on_create :after_validation_on_create_unless_with_proc_condition,
153   - :unless => lambda {|company| company.attribute_24 == 'after_validation_on_create_unless_with_proc_condition'}
154   -
155   - def after_validation_on_create_if_with_proc_condition
156   - self.attribute_23 = 'attribute_23'
157   - end
158   -
159   - def after_validation_on_create_unless_with_proc_condition
160   - self.attribute_24 = 'attribute_24'
161   - end
162   -
163   - before_validation_on_update :before_validation_on_update_if_with_proc_condition,
164   - :if => lambda {|company| company.attribute_25 == 'before_validation_on_update_if_with_proc_condition'}
165   - before_validation_on_update :before_validation_on_update_unless_with_proc_condition,
166   - :unless => lambda {|company| company.attribute_26 == 'before_validation_on_update_unless_with_proc_condition'}
167   -
168   - def before_validation_on_update_if_with_proc_condition
169   - self.attribute_25 = 'attribute_25'
170   - end
171   -
172   - def before_validation_on_update_unless_with_proc_condition
173   - self.attribute_26 = 'attribute_26'
174   - end
175   -
176   - after_validation_on_update :after_validation_on_update_if_with_proc_condition,
177   - :if => lambda {|company| company.attribute_27 == 'after_validation_on_update_if_with_proc_condition'}
178   - after_validation_on_update :after_validation_on_update_unless_with_proc_condition,
179   - :unless => lambda {|company| company.attribute_28 == 'after_validation_on_update_unless_with_proc_condition'}
180   -
181   - def after_validation_on_update_if_with_proc_condition
182   - self.attribute_27 = 'attribute_27'
183   - end
184   -
185   - def after_validation_on_update_unless_with_proc_condition
186   - self.attribute_28 = 'attribute_28'
187   - end
188   -
189   - after_initialize :after_initialize_if_with_proc_condition,
190   - :if => lambda {|company| company.attribute_29 == 'after_initialize_if_with_proc_condition'}
191   - after_initialize :after_initialize_unless_with_proc_condition,
192   - :unless => lambda {|company| company.attribute_30 == 'after_initialize_unless_with_proc_condition'}
193   -
194   - def after_initialize
195   - end
196   -
197   - def after_initialize_if_with_proc_condition
198   - self.attribute_29 = 'attribute_29'
199   - end
200   -
201   - def after_initialize_unless_with_proc_condition
202   - self.attribute_30 = 'attribute_30'
203   - end
204   -
205   - after_find :after_find_if_with_proc_condition,
206   - :if => lambda {|company| company.name == 'after_find_if_with_proc_condition'}
207   - after_find :after_find_unless_with_proc_condition,
208   - :unless => lambda {|company| company.name == 'after_find_unless_with_proc_condition'}
209   -
210   - def after_find
211   - end
212   -
213   - def after_find_if_with_proc_condition
214   - self.attribute_31 = 'attribute_31'
215   - end
216   -
217   - def after_find_unless_with_proc_condition
218   - self.attribute_32 = 'attribute_32'
219   - end
220   -
221   - validate :validate_if_with_proc_condition,
222   - :if => lambda {|company| company.attribute_33 == 'validate_if_with_proc_condition'}
223   - validate :validate_unless_with_proc_condition,
224   - :unless => lambda {|company| company.attribute_34 == 'validate_unless_with_proc_condition'}
225   -
226   - def validate_if_with_proc_condition
227   - self.attribute_33 = 'attribute_33'
228   - end
229   -
230   - def validate_unless_with_proc_condition
231   - self.attribute_34 = 'attribute_34'
232   - end
233   -
234   - validate_on_create :validate_on_create_if_with_proc_condition,
235   - :if => lambda {|company| company.attribute_35 == 'validate_on_create_if_with_proc_condition'}
236   - validate_on_create :validate_on_create_unless_with_proc_condition,
237   - :unless => lambda {|company| company.attribute_36 == 'validate_on_create_unless_with_proc_condition'}
238   -
239   - def validate_on_create_if_with_proc_condition
240   - self.attribute_35 = 'attribute_35'
241   - end
242   -
243   - def validate_on_create_unless_with_proc_condition
244   - self.attribute_36 = 'attribute_36'
245   - end
246   -
247   - validate_on_update :validate_on_update_if_with_proc_condition,
248   - :if => lambda {|company| company.attribute_37 == 'validate_on_update_if_with_proc_condition'}
249   - validate_on_update :validate_on_update_unless_with_proc_condition,
250   - :unless => lambda {|company| company.attribute_38 == 'validate_on_update_unless_with_proc_condition'}
251   -
252   - def validate_on_update_if_with_proc_condition
253   - self.attribute_37 = 'attribute_37'
254   - end
255   -
256   - def validate_on_update_unless_with_proc_condition
257   - self.attribute_38 = 'attribute_38'
258   - end
259   -
260   - before_create :before_create_if_with_string_condition,
261   - :if => 'attribute_39 == "before_create_if_with_string_condition"'
262   - before_create :before_create_unless_with_string_condition,
263   - :unless => 'attribute_40 == "before_create_unless_with_string_condition"'
264   -
265   - def before_create_if_with_string_condition
266   - self.attribute_39 = 'attribute_39'
267   - end
268   -
269   - def before_create_unless_with_string_condition
270   - self.attribute_40 = 'attribute_40'
271   - end
272   -
273   - after_create :after_create_if_with_string_condition,
274   - :if => 'attribute_41 == "after_create_if_with_string_condition"'
275   - after_create :after_create_unless_with_string_condition,
276   - :unless => 'attribute_42 == "after_create_unless_with_string_condition"'
277   -
278   - def after_create_if_with_string_condition
279   - self.attribute_41 = 'attribute_41'
280   - end
281   -
282   - def after_create_unless_with_string_condition
283   - self.attribute_42 = 'attribute_42'
284   - end
285   -
286   - before_save :before_save_if_with_string_condition,
287   - :if => 'attribute_43 == "before_save_if_with_string_condition"'
288   - before_save :before_save_unless_with_string_condition,
289   - :unless => 'attribute_44 == "before_save_unless_with_string_condition"'
290   -
291   - def before_save_if_with_string_condition
292   - self.attribute_43 = 'attribute_43'
293   - end
294   -
295   - def before_save_unless_with_string_condition
296   - self.attribute_44 = 'attribute_44'
297   - end
298   -
299   - after_save :after_save_if_with_string_condition,
300   - :if => 'attribute_45 == "after_save_if_with_string_condition"'
301   - after_save :after_save_unless_with_string_condition,
302   - :unless => 'attribute_46 == "after_save_unless_with_string_condition"'
303   -
304   - def after_save_if_with_string_condition
305   - self.attribute_45 = 'attribute_45'
306   - end
307   -
308   - def after_save_unless_with_string_condition
309   - self.attribute_46 = 'attribute_46'
310   - end
311   -
312   - before_destroy :before_destroy_if_with_string_condition,
313   - :if => 'attribute_47 == "before_destroy_if_with_string_condition"'
314   - before_destroy :before_destroy_unless_with_string_condition,
315   - :unless => 'attribute_48 == "before_destroy_unless_with_string_condition"'
316   -
317   - def before_destroy_if_with_string_condition
318   - self.attribute_47 = 'attribute_47'
319   - end
320   -
321   - def before_destroy_unless_with_string_condition
322   - self.attribute_48 = 'attribute_48'
323   - end
324   -
325   - after_destroy :after_destroy_if_with_string_condition,
326   - :if => 'attribute_49 == "after_destroy_if_with_string_condition"'
327   - after_destroy :after_destroy_unless_with_string_condition,
328   - :unless => 'attribute_50 == "after_destroy_unless_with_string_condition"'
329   -
330   - def after_destroy_if_with_string_condition
331   - self.attribute_49 = 'attribute_49'
332   - end
333   -
334   - def after_destroy_unless_with_string_condition
335   - self.attribute_50 = 'attribute_50'
336   - end
337   -
338   - before_update :before_update_if_with_string_condition,
339   - :if => 'attribute_51 == "before_update_if_with_string_condition"'
340   - before_update :before_update_unless_with_string_condition,
341   - :unless => 'attribute_52 == "before_update_unless_with_string_condition"'
342   -
343   - def before_update_if_with_string_condition
344   - self.attribute_51 = 'attribute_51'
345   - end
346   -
347   - def before_update_unless_with_string_condition
348   - self.attribute_52 = 'attribute_52'
349   - end
350   -
351   - after_update :after_update_if_with_string_condition,
352   - :if => 'attribute_53 == "after_update_if_with_string_condition"'
353   - after_update :after_update_unless_with_string_condition,
354   - :unless => 'attribute_54 == "after_update_unless_with_string_condition"'
355   -
356   - def after_update_if_with_string_condition
357   - self.attribute_53 = 'attribute_53'
358   - end
359   -
360   - def after_update_unless_with_string_condition
361   - self.attribute_54 = 'attribute_54'
362   - end
363   -
364   - before_validation :before_validation_if_with_string_condition,
365   - :if => 'attribute_55 == "before_validation_if_with_string_condition"'
366   - before_validation :before_validation_unless_with_string_condition,
367   - :unless => 'attribute_56 == "before_validation_unless_with_string_condition"'
368   -
369   - def before_validation_if_with_string_condition
370   - self.attribute_55 = 'attribute_55'
371   - end
372   -
373   - def before_validation_unless_with_string_condition
374   - self.attribute_56 = 'attribute_56'
375   - end
376   -
377   - after_validation :after_validation_if_with_string_condition,
378   - :if => 'attribute_57 == "after_validation_if_with_string_condition"'
379   - after_validation :after_validation_unless_with_string_condition,
380   - :unless => 'attribute_58 == "after_validation_unless_with_string_condition"'
381   -
382   - def after_validation_if_with_string_condition
383   - self.attribute_57 = 'attribute_57'
384   - end
385   -
386   - def after_validation_unless_with_string_condition
387   - self.attribute_58 = 'attribute_58'
388   - end
389   -
390   - before_validation_on_create :before_validation_on_create_if_with_string_condition,
391   - :if => 'attribute_59 == "before_validation_on_create_if_with_string_condition"'
392   - before_validation_on_create :before_validation_on_create_unless_with_string_condition,
393   - :unless => 'attribute_60 == "before_validation_on_create_unless_with_string_condition"'
394   -
395   - def before_validation_on_create_if_with_string_condition
396   - self.attribute_59 = 'attribute_59'
397   - end
398   -
399   - def before_validation_on_create_unless_with_string_condition
400   - self.attribute_60 = 'attribute_60'
401   - end
402   -
403   - after_validation_on_create :after_validation_on_create_if_with_string_condition,
404   - :if => 'attribute_61 == "after_validation_on_create_if_with_string_condition"'
405   - after_validation_on_create :after_validation_on_create_unless_with_string_condition,
406   - :unless => 'attribute_62 == "after_validation_on_create_unless_with_string_condition"'
407   -
408   - def after_validation_on_create_if_with_string_condition
409   - self.attribute_61 = 'attribute_61'
410   - end
411   -
412   - def after_validation_on_create_unless_with_string_condition
413   - self.attribute_62 = 'attribute_62'
414   - end
415   -
416   - before_validation_on_update :before_validation_on_update_if_with_string_condition,
417   - :if => 'attribute_63 == "before_validation_on_update_if_with_string_condition"'
418   - before_validation_on_update :before_validation_on_update_unless_with_string_condition,
419   - :unless => 'attribute_64 == "before_validation_on_update_unless_with_string_condition"'
420   -
421   - def before_validation_on_update_if_with_string_condition
422   - self.attribute_63 = 'attribute_63'
423   - end
424   -
425   - def before_validation_on_update_unless_with_string_condition
426   - self.attribute_64 = 'attribute_64'
427   - end
428   -
429   - after_validation_on_update :after_validation_on_update_if_with_string_condition,
430   - :if => 'attribute_65 == "after_validation_on_update_if_with_string_condition"'
431   - after_validation_on_update :after_validation_on_update_unless_with_string_condition,
432   - :unless => 'attribute_66 == "after_validation_on_update_unless_with_string_condition"'
433   -
434   - def after_validation_on_update_if_with_string_condition
435   - self.attribute_65 = 'attribute_65'
436   - end
437   -
438   - def after_validation_on_update_unless_with_string_condition
439   - self.attribute_66 = 'attribute_66'
440   - end
441   -
442   - after_initialize :after_initialize_if_with_string_condition,
443   - :if => 'attribute_67 == "after_initialize_if_with_string_condition"'
444   - after_initialize :after_initialize_unless_with_string_condition,
445   - :unless => 'attribute_68 == "after_initialize_unless_with_string_condition"'
446   -
447   - def after_initialize
448   - end
449   -
450   - def after_initialize_if_with_string_condition
451   - self.attribute_67 = 'attribute_67'
452   - end
453   -
454   - def after_initialize_unless_with_string_condition
455   - self.attribute_68 = 'attribute_68'
456   - end
457   -
458   - after_find :after_find_if_with_string_condition,
459   - :if => 'name == "after_find_if_with_string_condition"'
460   - after_find :after_find_unless_with_string_condition,
461   - :unless => 'name == "after_find_unless_with_string_condition"'
  3 + attr_accessor :callback_flag
  4 +
  5 + protected
  6 +
  7 + def change_name
  8 + self.name = 'new name' unless self.frozen?
  9 + end
  10 +
  11 + # (1..114).each do |each|
  12 + # attr_accessor :"attribute_#{each}"
  13 + # end
  14 + #
  15 + # before_create :before_create_if_with_proc_condition,
  16 + # :if => lambda {|company| company.attribute_1 == 'before_create_if_with_proc_condition'}
  17 + # before_create :before_create_unless_with_proc_condition,
  18 + # :unless => lambda {|company| company.attribute_2 == 'before_create_unless_with_proc_condition'}
  19 + #
  20 + # def before_create_if_with_proc_condition
  21 + # self.attribute_1 = 'attribute_1'
  22 + # end
  23 + #
  24 + # def before_create_unless_with_proc_condition
  25 + # self.attribute_2 = 'attribute_2'
  26 + # end
  27 + #
  28 + # after_create :after_create_if_with_proc_condition,
  29 + # :if => lambda {|company| company.attribute_3 == 'after_create_if_with_proc_condition'}
  30 + # after_create :after_create_unless_with_proc_condition,
  31 + # :unless => lambda {|company| company.attribute_4 == 'after_create_unless_with_proc_condition'}
  32 + #
  33 + # def after_create_if_with_proc_condition
  34 + # self.attribute_3 = 'attribute_3'
  35 + # end
  36 + #
  37 + # def after_create_unless_with_proc_condition
  38 + # self.attribute_4 = 'attribute_4'
  39 + # end
  40 + #
  41 + # before_save :before_save_if_with_proc_condition,
  42 + # :if => lambda {|company| company.attribute_5 == 'before_save_if_with_proc_condition'}
  43 + # before_save :before_save_unless_with_proc_condition,
  44 + # :unless => lambda {|company| company.attribute_6 == 'before_save_unless_with_proc_condition'}
  45 + #
  46 + # def before_save_if_with_proc_condition
  47 + # self.attribute_5 = 'attribute_5'
  48 + # end
  49 + #
  50 + # def before_save_unless_with_proc_condition
  51 + # self.attribute_6 = 'attribute_6'
  52 + # end
  53 + #
  54 + # after_save :after_save_if_with_proc_condition,
  55 + # :if => lambda {|company| company.attribute_7 == 'after_save_if_with_proc_condition'}
  56 + # after_save :after_save_unless_with_proc_condition,
  57 + # :unless => lambda {|company| company.attribute_8 == 'after_save_unless_with_proc_condition'}
  58 + #
  59 + # def after_save_if_with_proc_condition
  60 + # self.attribute_7 = 'attribute_7'
  61 + # end
  62 + #
  63 + # def after_save_unless_with_proc_condition
  64 + # self.attribute_8 = 'attribute_8'
  65 + # end
  66 + #
  67 + # before_destroy :before_destroy_if_with_proc_condition,
  68 + # :if => lambda {|company| company.attribute_9 == 'before_destroy_if_with_proc_condition'}
  69 + # before_destroy :before_destroy_unless_with_proc_condition,
  70 + # :unless => lambda {|company| company.attribute_10 == 'before_destroy_unless_with_proc_condition'}
  71 + #
  72 + # def before_destroy_if_with_proc_condition
  73 + # self.attribute_9 = 'attribute_9'
  74 + # end
  75 + #
  76 + # def before_destroy_unless_with_proc_condition
  77 + # self.attribute_10 = 'attribute_10'
  78 + # end
  79 + #
  80 + # after_destroy :after_destroy_if_with_proc_condition,
  81 + # :if => lambda {|company| company.attribute_11 == 'after_destroy_if_with_proc_condition'}
  82 + # after_destroy :after_destroy_unless_with_proc_condition,
  83 + # :unless => lambda {|company| company.attribute_12 == 'after_destroy_unless_with_proc_condition'}
  84 + #
  85 + # def after_destroy_if_with_proc_condition
  86 + # self.attribute_11 = 'attribute_11'
  87 + # end
  88 + #
  89 + # def after_destroy_unless_with_proc_condition
  90 + # self.attribute_12 = 'attribute_12'
  91 + # end
  92 + #
  93 + # before_update :before_update_if_with_proc_condition,
  94 + # :if => lambda {|company| company.attribute_13 == 'before_update_if_with_proc_condition'}
  95 + # before_update :before_update_unless_with_proc_condition,
  96 + # :unless => lambda {|company| company.attribute_14 == 'before_update_unless_with_proc_condition'}
  97 + #
  98 + # def before_update_if_with_proc_condition
  99 + # self.attribute_13 = 'attribute_13'
  100 + # end
  101 + #
  102 + # def before_update_unless_with_proc_condition
  103 + # self.attribute_14 = 'attribute_14'
  104 + # end
  105 + #
  106 + # after_update :after_update_if_with_proc_condition,
  107 + # :if => lambda {|company| company.attribute_15 == 'after_update_if_with_proc_condition'}
  108 + # after_update :after_update_unless_with_proc_condition,
  109 + # :unless => lambda {|company| company.attribute_16 == 'after_update_unless_with_proc_condition'}
  110 + #
  111 + # def after_update_if_with_proc_condition
  112 + # self.attribute_15 = 'attribute_15'
  113 + # end
  114 + #
  115 + # def after_update_unless_with_proc_condition
  116 + # self.attribute_16 = 'attribute_16'
  117 + # end
  118 + #
  119 + # before_validation :before_validation_if_with_proc_condition,
  120 + # :if => lambda {|company| company.attribute_17 == 'before_validation_if_with_proc_condition'}
  121 + # before_validation :before_validation_unless_with_proc_condition,
  122 + # :unless => lambda {|company| company.attribute_18 == 'before_validation_unless_with_proc_condition'}
  123 + #
  124 + # def before_validation_if_with_proc_condition
  125 + # self.attribute_17 = 'attribute_17'
  126 + # end
  127 + #
  128 + # def before_validation_unless_with_proc_condition
  129 + # self.attribute_18 = 'attribute_18'
  130 + # end
  131 + #
  132 + # after_validation :after_validation_if_with_proc_condition,
  133 + # :if => lambda {|company| company.attribute_19 == 'after_validation_if_with_proc_condition'}
  134 + # after_validation :after_validation_unless_with_proc_condition,
  135 + # :unless => lambda {|company| company.attribute_20 == 'after_validation_unless_with_proc_condition'}
  136 + #
  137 + # def after_validation_if_with_proc_condition
  138 + # self.attribute_19 = 'attribute_19'
  139 + # end
  140 + #
  141 + # def after_validation_unless_with_proc_condition
  142 + # self.attribute_20 = 'attribute_20'
  143 + # end
  144 + #
  145 + # before_validation_on_create :before_validation_on_create_if_with_proc_condition,
  146 + # :if => lambda {|company| company.attribute_21 == 'before_validation_on_create_if_with_proc_condition'}
  147 + # before_validation_on_create :before_validation_on_create_unless_with_proc_condition,
  148 + # :unless => lambda {|company| company.attribute_22 == 'before_validation_on_create_unless_with_proc_condition'}
  149 + #
  150 + # def before_validation_on_create_if_with_proc_condition
  151 + # self.attribute_21 = 'attribute_21'
  152 + # end
  153 + #
  154 + # def before_validation_on_create_unless_with_proc_condition
  155 + # self.attribute_22 = 'attribute_22'
  156 + # end
  157 + #
  158 + # after_validation_on_create :after_validation_on_create_if_with_proc_condition,
  159 + # :if => lambda {|company| company.attribute_23 == 'after_validation_on_create_if_with_proc_condition'}
  160 + # after_validation_on_create :after_validation_on_create_unless_with_proc_condition,
  161 + # :unless => lambda {|company| company.attribute_24 == 'after_validation_on_create_unless_with_proc_condition'}
  162 + #
  163 + # def after_validation_on_create_if_with_proc_condition
  164 + # self.attribute_23 = 'attribute_23'
  165 + # end
  166 + #
  167 + # def after_validation_on_create_unless_with_proc_condition
  168 + # self.attribute_24 = 'attribute_24'
  169 + # end
  170 + #
  171 + # before_validation_on_update :before_validation_on_update_if_with_proc_condition,
  172 + # :if => lambda {|company| company.attribute_25 == 'before_validation_on_update_if_with_proc_condition'}
  173 + # before_validation_on_update :before_validation_on_update_unless_with_proc_condition,
  174 + # :unless => lambda {|company| company.attribute_26 == 'before_validation_on_update_unless_with_proc_condition'}
  175 + #
  176 + # def before_validation_on_update_if_with_proc_condition
  177 + # self.attribute_25 = 'attribute_25'
  178 + # end
  179 + #
  180 + # def before_validation_on_update_unless_with_proc_condition
  181 + # self.attribute_26 = 'attribute_26'
  182 + # end
  183 + #
  184 + # after_validation_on_update :after_validation_on_update_if_with_proc_condition,
  185 + # :if => lambda {|company| company.attribute_27 == 'after_validation_on_update_if_with_proc_condition'}
  186 + # after_validation_on_update :after_validation_on_update_unless_with_proc_condition,
  187 + # :unless => lambda {|company| company.attribute_28 == 'after_validation_on_update_unless_with_proc_condition'}
  188 + #
  189 + # def after_validation_on_update_if_with_proc_condition
  190 + # self.attribute_27 = 'attribute_27'
  191 + # end
  192 + #
  193 + # def after_validation_on_update_unless_with_proc_condition
  194 + # self.attribute_28 = 'attribute_28'
  195 + # end
  196 + #
  197 + # after_initialize :after_initialize_if_with_proc_condition,
  198 + # :if => lambda {|company| company.attribute_29 == 'after_initialize_if_with_proc_condition'}
  199 + # after_initialize :after_initialize_unless_with_proc_condition,
  200 + # :unless => lambda {|company| company.attribute_30 == 'after_initialize_unless_with_proc_condition'}
  201 + #
  202 + # def after_initialize
  203 + # end
  204 + #
  205 + # def after_initialize_if_with_proc_condition
  206 + # self.attribute_29 = 'attribute_29'
  207 + # end
  208 + #
  209 + # def after_initialize_unless_with_proc_condition
  210 + # self.attribute_30 = 'attribute_30'
  211 + # end
  212 + #
  213 + # after_find :after_find_if_with_proc_condition,
  214 + # :if => lambda {|company| company.name == 'after_find_if_with_proc_condition'}
  215 + # after_find :after_find_unless_with_proc_condition,
  216 + # :unless => lambda {|company| company.name == 'after_find_unless_with_proc_condition'}
  217 + #
  218 + # def after_find
  219 + # end
  220 + #
  221 + # def after_find_if_with_proc_condition
  222 + # self.attribute_31 = 'attribute_31'
  223 + # end
  224 + #
  225 + # def after_find_unless_with_proc_condition
  226 + # self.attribute_32 = 'attribute_32'
  227 + # end
  228 + #
  229 + # validate :validate_if_with_proc_condition,
  230 + # :if => lambda {|company| company.attribute_33 == 'validate_if_with_proc_condition'}
  231 + # validate :validate_unless_with_proc_condition,
  232 + # :unless => lambda {|company| company.attribute_34 == 'validate_unless_with_proc_condition'}
  233 + #
  234 + # def validate_if_with_proc_condition
  235 + # self.attribute_33 = 'attribute_33'
  236 + # end
  237 + #
  238 + # def validate_unless_with_proc_condition
  239 + # self.attribute_34 = 'attribute_34'
  240 + # end
  241 + #
  242 + # validate_on_create :validate_on_create_if_with_proc_condition,
  243 + # :if => lambda {|company| company.attribute_35 == 'validate_on_create_if_with_proc_condition'}
  244 + # validate_on_create :validate_on_create_unless_with_proc_condition,
  245 + # :unless => lambda {|company| company.attribute_36 == 'validate_on_create_unless_with_proc_condition'}
  246 + #
  247 + # def validate_on_create_if_with_proc_condition
  248 + # self.attribute_35 = 'attribute_35'
  249 + # end
  250 + #
  251 + # def validate_on_create_unless_with_proc_condition
  252 + # self.attribute_36 = 'attribute_36'
  253 + # end
  254 + #
  255 + # validate_on_update :validate_on_update_if_with_proc_condition,
  256 + # :if => lambda {|company| company.attribute_37 == 'validate_on_update_if_with_proc_condition'}
  257 + # validate_on_update :validate_on_update_unless_with_proc_condition,
  258 + # :unless => lambda {|company| company.attribute_38 == 'validate_on_update_unless_with_proc_condition'}
  259 + #
  260 + # def validate_on_update_if_with_proc_condition
  261 + # self.attribute_37 = 'attribute_37'
  262 + # end
  263 + #
  264 + # def validate_on_update_unless_with_proc_condition
  265 + # self.attribute_38 = 'attribute_38'
  266 + # end
  267 + #
  268 + # before_create :before_create_if_with_string_condition,
  269 + # :if => 'attribute_39 == "before_create_if_with_string_condition"'
  270 + # before_create :before_create_unless_with_string_condition,
  271 + # :unless => 'attribute_40 == "before_create_unless_with_string_condition"'
  272 + #
  273 + # def before_create_if_with_string_condition
  274 + # self.attribute_39 = 'attribute_39'
  275 + # end
  276 + #
  277 + # def before_create_unless_with_string_condition
  278 + # self.attribute_40 = 'attribute_40'
  279 + # end
  280 + #
  281 + # after_create :after_create_if_with_string_condition,
  282 + # :if => 'attribute_41 == "after_create_if_with_string_condition"'
  283 + # after_create :after_create_unless_with_string_condition,
  284 + # :unless => 'attribute_42 == "after_create_unless_with_string_condition"'
  285 + #
  286 + # def after_create_if_with_string_condition
  287 + # self.attribute_41 = 'attribute_41'
  288 + # end
  289 + #
  290 + # def after_create_unless_with_string_condition
  291 + # self.attribute_42 = 'attribute_42'
  292 + # end
  293 + #
  294 + # before_save :before_save_if_with_string_condition,
  295 + # :if => 'attribute_43 == "before_save_if_with_string_condition"'
  296 + # before_save :before_save_unless_with_string_condition,
  297 + # :unless => 'attribute_44 == "before_save_unless_with_string_condition"'
  298 + #
  299 + # def before_save_if_with_string_condition
  300 + # self.attribute_43 = 'attribute_43'
  301 + # end
  302 + #
  303 + # def before_save_unless_with_string_condition
  304 + # self.attribute_44 = 'attribute_44'
  305 + # end
  306 + #
  307 + # after_save :after_save_if_with_string_condition,
  308 + # :if => 'attribute_45 == "after_save_if_with_string_condition"'
  309 + # after_save :after_save_unless_with_string_condition,
  310 + # :unless => 'attribute_46 == "after_save_unless_with_string_condition"'
  311 + #
  312 + # def after_save_if_with_string_condition
  313 + # self.attribute_45 = 'attribute_45'
  314 + # end
  315 + #
  316 + # def after_save_unless_with_string_condition
  317 + # self.attribute_46 = 'attribute_46'
  318 + # end
  319 + #
  320 + # before_destroy :before_destroy_if_with_string_condition,
  321 + # :if => 'attribute_47 == "before_destroy_if_with_string_condition"'
  322 + # before_destroy :before_destroy_unless_with_string_condition,
  323 + # :unless => 'attribute_48 == "before_destroy_unless_with_string_condition"'
  324 + #
  325 + # def before_destroy_if_with_string_condition
  326 + # self.attribute_47 = 'attribute_47'
  327 + # end
  328 + #
  329 + # def before_destroy_unless_with_string_condition
  330 + # self.attribute_48 = 'attribute_48'
  331 + # end
  332 + #
  333 + # after_destroy :after_destroy_if_with_string_condition,
  334 + # :if => 'attribute_49 == "after_destroy_if_with_string_condition"'
  335 + # after_destroy :after_destroy_unless_with_string_condition,
  336 + # :unless => 'attribute_50 == "after_destroy_unless_with_string_condition"'
  337 + #
  338 + # def after_destroy_if_with_string_condition
  339 + # self.attribute_49 = 'attribute_49'
  340 + # end
  341 + #
  342 + # def after_destroy_unless_with_string_condition
  343 + # self.attribute_50 = 'attribute_50'
  344 + # end
  345 + #
  346 + # before_update :before_update_if_with_string_condition,
  347 + # :if => 'attribute_51 == "before_update_if_with_string_condition"'
  348 + # before_update :before_update_unless_with_string_condition,
  349 + # :unless => 'attribute_52 == "before_update_unless_with_string_condition"'
  350 + #
  351 + # def before_update_if_with_string_condition
  352 + # self.attribute_51 = 'attribute_51'
  353 + # end
  354 + #
  355 + # def before_update_unless_with_string_condition
  356 + # self.attribute_52 = 'attribute_52'
  357 + # end
  358 + #
  359 + # after_update :after_update_if_with_string_condition,
  360 + # :if => 'attribute_53 == "after_update_if_with_string_condition"'
  361 + # after_update :after_update_unless_with_string_condition,
  362 + # :unless => 'attribute_54 == "after_update_unless_with_string_condition"'
  363 + #
  364 + # def after_update_if_with_string_condition
  365 + # self.attribute_53 = 'attribute_53'
  366 + # end
  367 + #
  368 + # def after_update_unless_with_string_condition
  369 + # self.attribute_54 = 'attribute_54'
  370 + # end
  371 + #
  372 + # before_validation :before_validation_if_with_string_condition,
  373 + # :if => 'attribute_55 == "before_validation_if_with_string_condition"'
  374 + # before_validation :before_validation_unless_with_string_condition,
  375 + # :unless => 'attribute_56 == "before_validation_unless_with_string_condition"'
  376 + #
  377 + # def before_validation_if_with_string_condition
  378 + # self.attribute_55 = 'attribute_55'
  379 + # end
  380 + #
  381 + # def before_validation_unless_with_string_condition
  382 + # self.attribute_56 = 'attribute_56'
  383 + # end
  384 + #
  385 + # after_validation :after_validation_if_with_string_condition,
  386 + # :if => 'attribute_57 == "after_validation_if_with_string_condition"'
  387 + # after_validation :after_validation_unless_with_string_condition,
  388 + # :unless => 'attribute_58 == "after_validation_unless_with_string_condition"'
  389 + #
  390 + # def after_validation_if_with_string_condition
  391 + # self.attribute_57 = 'attribute_57'
  392 + # end
  393 + #
  394 + # def after_validation_unless_with_string_condition
  395 + # self.attribute_58 = 'attribute_58'
  396 + # end
  397 + #
  398 + # before_validation_on_create :before_validation_on_create_if_with_string_condition,
  399 + # :if => 'attribute_59 == "before_validation_on_create_if_with_string_condition"'
  400 + # before_validation_on_create :before_validation_on_create_unless_with_string_condition,
  401 + # :unless => 'attribute_60 == "before_validation_on_create_unless_with_string_condition"'
  402 + #
  403 + # def before_validation_on_create_if_with_string_condition
  404 + # self.attribute_59 = 'attribute_59'
  405 + # end
  406 + #
  407 + # def before_validation_on_create_unless_with_string_condition
  408 + # self.attribute_60 = 'attribute_60'
  409 + # end
  410 + #
  411 + # after_validation_on_create :after_validation_on_create_if_with_string_condition,
  412 + # :if => 'attribute_61 == "after_validation_on_create_if_with_string_condition"'
  413 + # after_validation_on_create :after_validation_on_create_unless_with_string_condition,
  414 + # :unless => 'attribute_62 == "after_validation_on_create_unless_with_string_condition"'
  415 + #
  416 + # def after_validation_on_create_if_with_string_condition
  417 + # self.attribute_61 = 'attribute_61'
  418 + # end
  419 + #
  420 + # def after_validation_on_create_unless_with_string_condition
  421 + # self.attribute_62 = 'attribute_62'
  422 + # end
  423 + #
  424 + # before_validation_on_update :before_validation_on_update_if_with_string_condition,
  425 + # :if => 'attribute_63 == "before_validation_on_update_if_with_string_condition"'
  426 + # before_validation_on_update :before_validation_on_update_unless_with_string_condition,
  427 + # :unless => 'attribute_64 == "before_validation_on_update_unless_with_string_condition"'
  428 + #
  429 + # def before_validation_on_update_if_with_string_condition
  430 + # self.attribute_63 = 'attribute_63'
  431 + # end
  432 + #
  433 + # def before_validation_on_update_unless_with_string_condition
  434 + # self.attribute_64 = 'attribute_64'
  435 + # end
  436 + #
  437 + # after_validation_on_update :after_validation_on_update_if_with_string_condition,
  438 + # :if => 'attribute_65 == "after_validation_on_update_if_with_string_condition"'
  439 + # after_validation_on_update :after_validation_on_update_unless_with_string_condition,
  440 + # :unless => 'attribute_66 == "after_validation_on_update_unless_with_string_condition"'
  441 + #
  442 + # def after_validation_on_update_if_with_string_condition
  443 + # self.attribute_65 = 'attribute_65'
  444 + # end
  445 + #
  446 + # def after_validation_on_update_unless_with_string_condition
  447 + # self.attribute_66 = 'attribute_66'
  448 + # end
  449 + #
  450 + # after_initialize :after_initialize_if_with_string_condition,
  451 + # :if => 'attribute_67 == "after_initialize_if_with_string_condition"'
  452 + # after_initialize :after_initialize_unless_with_string_condition,
  453 + # :unless => 'attribute_68 == "after_initialize_unless_with_string_condition"'
  454 + #
  455 + # def after_initialize
  456 + # end
  457 + #
  458 + # def after_initialize_if_with_string_condition
  459 + # self.attribute_67 = 'attribute_67'
  460 + # end
  461 + #
  462 + # def after_initialize_unless_with_string_condition
  463 + # self.attribute_68 = 'attribute_68'
  464 + # end
  465 + #
  466 + # after_find :after_find_if_with_string_condition,
  467 + # :if => 'name == "after_find_if_with_string_condition"'
  468 + # after_find :after_find_unless_with_string_condition,
  469 + # :unless => 'name == "after_find_unless_with_string_condition"'
  470 + #
  471 + # def after_find
  472 + # end
  473 + #
  474 + # def after_find_if_with_string_condition
  475 + # self.attribute_69 = 'attribute_69'
  476 + # end
  477 + #
  478 + # def after_find_unless_with_string_condition
  479 + # self.attribute_70 = 'attribute_70'
  480 + # end
  481 + #
  482 + # validate :validate_if_with_string_condition,
  483 + # :if => 'attribute_71 == "validate_if_with_string_condition"'
  484 + # validate :validate_unless_with_string_condition,
  485 + # :unless => 'attribute_72 == "validate_unless_with_string_condition"'
  486 + #
  487 + # def validate_if_with_string_condition
  488 + # self.attribute_71 = 'attribute_71'
  489 + # end
  490 + #
  491 + # def validate_unless_with_string_condition
  492 + # self.attribute_72 = 'attribute_72'
  493 + # end
  494 + #
  495 + # validate_on_create :validate_on_create_if_with_string_condition,
  496 + # :if => 'attribute_73 == "validate_on_create_if_with_string_condition"'
  497 + # validate_on_create :validate_on_create_unless_with_string_condition,
  498 + # :unless => 'attribute_74 == "validate_on_create_unless_with_string_condition"'
  499 + #
  500 + # def validate_on_create_if_with_string_condition
  501 + # self.attribute_73 = 'attribute_73'
  502 + # end
  503 + #
  504 + # def validate_on_create_unless_with_string_condition
  505 + # self.attribute_74 = 'attribute_74'
  506 + # end
  507 + #
  508 + # validate_on_update :validate_on_update_if_with_string_condition,
  509 + # :if => 'attribute_75 == "validate_on_update_if_with_string_condition"'
  510 + # validate_on_update :validate_on_update_unless_with_string_condition,
  511 + # :unless => 'attribute_76 == "validate_on_update_unless_with_string_condition"'
  512 + #
  513 + # def validate_on_update_if_with_string_condition
  514 + # self.attribute_75 = 'attribute_75'
  515 + # end