public
Fork of rails/rails
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/JackDanger/rails.git
Search Repo:
Prefer string core_ext inflector methods over directly accessing 
Inflector.
josh (author)
Wed May 14 12:09:49 -0700 2008
commit  3b0e1d90938e3d4c98830e037b3da15b3f736f7f
tree    6e57d3b855939aa800bcac51647ab6906c13b217
parent  f32b974338cb965a27d521b32304aebd9811a9ba
...
11
12
13
14
 
15
16
17
18
 
 
19
20
21
...
48
49
50
51
 
52
53
54
...
57
58
59
60
 
61
62
63
...
71
72
73
74
 
75
76
77
 
78
79
80
 
 
81
82
83
 
84
85
86
87
 
88
89
90
91
92
93
 
94
95
96
97
 
98
99
100
101
102
103
104
 
105
106
107
108
109
 
110
111
112
113
114
115
 
116
117
118
...
133
134
135
136
 
137
138
139
...
155
156
157
158
 
159
160
161
162
 
163
164
165
166
167
168
 
169
170
171
...
191
192
193
194
 
195
196
197
...
209
210
211
212
 
213
214
215
...
226
227
228
229
 
230
231
232
 
233
234
235
...
249
250
251
252
253
254
255
256
257
 
 
 
 
 
 
258
259
260
261
 
262
263
264
...
270
271
272
273
 
274
275
276
 
277
278
279
...
282
283
284
285
 
286
287
288
...
291
292
293
294
 
295
296
297
298
299
 
300
301
302
 
303
304
305
306
 
307
308
309
310
 
311
312
313
 
314
315
316
 
317
318
319
320
 
321
322
323
 
324
325
326
327
 
328
329
330
331
 
332
333
334
 
335
336
337
...
347
348
349
350
 
351
352
353
...
425
426
427
428
 
429
430
431
...
511
512
513
514
 
515
516
517
...
597
598
599
600
 
601
602
603
...
612
613
614
615
 
616
617
618
...
11
12
13
 
14
15
16
 
 
17
18
19
20
21
...
48
49
50
 
51
52
53
54
...
57
58
59
 
60
61
62
63
...
71
72
73
 
74
75
76
 
77
78
 
 
79
80
81
82
 
83
84
85
86
 
87
88
89
90
91
92
 
93
94
95
96
 
97
98
99
100
101
102
103
 
104
105
106
107
108
 
109
110
111
112
113
114
 
115
116
117
118
...
133
134
135
 
136
137
138
139
...
155
156
157
 
158
159
160
161
 
162
163
164
165
166
167
 
168
169
170
171
...
191
192
193
 
194
195
196
197
...
209
210
211
 
212
213
214
215
...
226
227
228
 
229
230
231
 
232
233
234
235
...
249
250
251
 
 
 
 
 
 
252
253
254
255
256
257
258
259
260
 
261
262
263
264
...
270
271
272
 
273
274
275
 
276
277
278
279
...
282
283
284
 
285
286
287
288
...
291
292
293
 
294
295
296
297
298
 
299
300
301
 
302
303
304
305
 
306
307
308
309
 
310
311
312
 
313
314
315
 
316
317
318
319
 
320
321
322
 
323
324
325
326
 
327
328
329
330
 
331
332
333
 
334
335
336
337
...
347
348
349
 
350
351
352
353
...
425
426
427
 
428
429
430
431
...
511
512
513
 
514
515
516
517
...
597
598
599
 
600
601
602
603
...
612
613
614
 
615
616
617
618
0
@@ -11,11 +11,11 @@ module ActionMailer #:nodoc:
0
   # = Mailer Models
0
   #
0
   # To use ActionMailer, you need to create a mailer model.
0
- #
0
+ #
0
   # $ script/generate mailer Notifier
0
   #
0
- # The generated model inherits from ActionMailer::Base. Emails are defined by creating methods within the model which are then
0
- # used to set variables to be used in the mail template, to change options on the mail, or
0
+ # The generated model inherits from ActionMailer::Base. Emails are defined by creating methods within the model which are then
0
+ # used to set variables to be used in the mail template, to change options on the mail, or
0
   # to add attachments.
0
   #
0
   # Examples:
0
@@ -48,7 +48,7 @@ module ActionMailer #:nodoc:
0
   # named after each key in the hash containing the value that that key points to.
0
   #
0
   # So, for example, <tt>body :account => recipient</tt> would result
0
- # in an instance variable <tt>@account</tt> with the value of <tt>recipient</tt> being accessible in the
0
+ # in an instance variable <tt>@account</tt> with the value of <tt>recipient</tt> being accessible in the
0
   # view.
0
   #
0
   #
0
@@ -57,7 +57,7 @@ module ActionMailer #:nodoc:
0
   # Like ActionController, each mailer class has a corresponding view directory
0
   # in which each method of the class looks for a template with its name.
0
   # To define a template to be used with a mailing, create an <tt>.erb</tt> file with the same name as the method
0
- # in your mailer model. For example, in the mailer defined above, the template at
0
+ # in your mailer model. For example, in the mailer defined above, the template at
0
   # <tt>app/views/notifier/signup_notification.erb</tt> would be used to generate the email.
0
   #
0
   # Variables defined in the model are accessible as instance variables in the view.
0
@@ -71,48 +71,48 @@ module ActionMailer #:nodoc:
0
   #
0
   # You got a new note!
0
   # <%= truncate(note.body, 25) %>
0
- #
0
+ #
0
   #
0
   # = Generating URLs
0
- #
0
+ #
0
   # URLs can be generated in mailer views using <tt>url_for</tt> or named routes.
0
- # Unlike controllers from Action Pack, the mailer instance doesn't have any context about the incoming request,
0
- # so you'll need to provide all of the details needed to generate a URL.
0
+ # Unlike controllers from Action Pack, the mailer instance doesn't have any context about the incoming request,
0
+ # so you'll need to provide all of the details needed to generate a URL.
0
   #
0
   # When using <tt>url_for</tt> you'll need to provide the <tt>:host</tt>, <tt>:controller</tt>, and <tt>:action</tt>:
0
- #
0
+ #
0
   # <%= url_for(:host => "example.com", :controller => "welcome", :action => "greeting") %>
0
   #
0
   # When using named routes you only need to supply the <tt>:host</tt>:
0
- #
0
+ #
0
   # <%= users_url(:host => "example.com") %>
0
   #
0
   # You will want to avoid using the <tt>name_of_route_path</tt> form of named routes because it doesn't make sense to
0
   # generate relative URLs in email messages.
0
   #
0
- # It is also possible to set a default host that will be used in all mailers by setting the <tt>:host</tt> option in
0
+ # It is also possible to set a default host that will be used in all mailers by setting the <tt>:host</tt> option in
0
   # the <tt>ActionMailer::Base.default_url_options</tt> hash as follows:
0
   #
0
   # ActionMailer::Base.default_url_options[:host] = "example.com"
0
- #
0
+ #
0
   # This can also be set as a configuration option in <tt>config/environment.rb</tt>:
0
   #
0
   # config.action_mailer.default_url_options = { :host => "example.com" }
0
   #
0
   # If you do decide to set a default <tt>:host</tt> for your mailers you will want to use the
0
   # <tt>:only_path => false</tt> option when using <tt>url_for</tt>. This will ensure that absolute URLs are generated because
0
- # the <tt>url_for</tt> view helper will, by default, generate relative URLs when a <tt>:host</tt> option isn't
0
+ # the <tt>url_for</tt> view helper will, by default, generate relative URLs when a <tt>:host</tt> option isn't
0
   # explicitly provided.
0
   #
0
   # = Sending mail
0
   #
0
- # Once a mailer action and template are defined, you can deliver your message or create it and save it
0
+ # Once a mailer action and template are defined, you can deliver your message or create it and save it
0
   # for delivery later:
0
   #
0
   # Notifier.deliver_signup_notification(david) # sends the email
0
   # mail = Notifier.create_signup_notification(david) # => a tmail object
0
   # Notifier.deliver(mail)
0
- #
0
+ #
0
   # You never instantiate your mailer class. Rather, your delivery instance
0
   # methods are automatically wrapped in class methods that start with the word
0
   # <tt>deliver_</tt> followed by the name of the mailer method that you would
0
@@ -133,7 +133,7 @@ module ActionMailer #:nodoc:
0
   # from "system@example.com"
0
   # content_type "text/html" # Here's where the magic happens
0
   # end
0
- # end
0
+ # end
0
   #
0
   #
0
   # = Multipart email
0
@@ -155,17 +155,17 @@ module ActionMailer #:nodoc:
0
   # end
0
   # end
0
   # end
0
- #
0
+ #
0
   # Multipart messages can also be used implicitly because ActionMailer will automatically
0
   # detect and use multipart templates, where each template is named after the name of the action, followed
0
   # by the content type. Each such detected template will be added as separate part to the message.
0
- #
0
+ #
0
   # For example, if the following templates existed:
0
   # * signup_notification.text.plain.erb
0
   # * signup_notification.text.html.erb
0
   # * signup_notification.text.xml.builder
0
   # * signup_notification.text.x-yaml.erb
0
- #
0
+ #
0
   # Each would be rendered and added as a separate part to the message,
0
   # with the corresponding content type. The same body hash is passed to
0
   # each template.
0
@@ -191,7 +191,7 @@ module ActionMailer #:nodoc:
0
   # a.body = generate_your_pdf_here()
0
   # end
0
   # end
0
- # end
0
+ # end
0
   #
0
   #
0
   # = Configuration options
0
@@ -209,7 +209,7 @@ module ActionMailer #:nodoc:
0
   # * <tt>:domain</tt> - If you need to specify a HELO domain, you can do it here.
0
   # * <tt>:user_name</tt> - If your mail server requires authentication, set the username in this setting.
0
   # * <tt>:password</tt> - If your mail server requires authentication, set the password in this setting.
0
- # * <tt>:authentication</tt> - If your mail server requires authentication, you need to specify the authentication type here.
0
+ # * <tt>:authentication</tt> - If your mail server requires authentication, you need to specify the authentication type here.
0
   # This is a symbol and one of <tt>:plain</tt>, <tt>:login</tt>, <tt>:cram_md5</tt>
0
   #
0
   # * <tt>sendmail_settings</tt> - Allows you to override options for the <tt>:sendmail</tt> delivery method
0
@@ -226,10 +226,10 @@ module ActionMailer #:nodoc:
0
   # * <tt>deliveries</tt> - Keeps an array of all the emails sent out through the Action Mailer with <tt>delivery_method :test</tt>. Most useful
0
   # for unit and functional testing.
0
   #
0
- # * <tt>default_charset</tt> - The default charset used for the body and to encode the subject. Defaults to UTF-8. You can also
0
+ # * <tt>default_charset</tt> - The default charset used for the body and to encode the subject. Defaults to UTF-8. You can also
0
   # pick a different charset from inside a method with <tt>@charset</tt>.
0
   # * <tt>default_content_type</tt> - The default content type used for the main part of the message. Defaults to "text/plain". You
0
- # can also pick a different content type from inside a method with <tt>@content_type</tt>.
0
+ # can also pick a different content type from inside a method with <tt>@content_type</tt>.
0
   # * <tt>default_mime_version</tt> - The default mime version used for the message. Defaults to "1.0". You
0
   # can also pick a different value from inside a method with <tt>@mime_version</tt>.
0
   # * <tt>default_implicit_parts_order</tt> - When a message is built implicitly (i.e. multiple parts are assembled from templates
0
@@ -249,16 +249,16 @@ module ActionMailer #:nodoc:
0
     cattr_accessor :template_extensions
0
     @@template_extensions = ['erb', 'builder', 'rhtml', 'rxml']
0
 
0
- @@smtp_settings = {
0
- :address => "localhost",
0
- :port => 25,
0
- :domain => 'localhost.localdomain',
0
- :user_name => nil,
0
- :password => nil,
0
+ @@smtp_settings = {
0
+ :address => "localhost",
0
+ :port => 25,
0
+ :domain => 'localhost.localdomain',
0
+ :user_name => nil,
0
+ :password => nil,
0
       :authentication => nil
0
     }
0
     cattr_accessor :smtp_settings
0
-
0
+
0
     @@sendmail_settings = {
0
       :location => '/usr/sbin/sendmail',
0
       :arguments => '-i -t'
0
@@ -270,10 +270,10 @@ module ActionMailer #:nodoc:
0
 
0
     superclass_delegating_accessor :delivery_method
0
     self.delivery_method = :smtp
0
-
0
+
0
     @@perform_deliveries = true
0
     cattr_accessor :perform_deliveries
0
-
0
+
0
     @@deliveries = []
0
     cattr_accessor :deliveries
0
 
0
@@ -282,7 +282,7 @@ module ActionMailer #:nodoc:
0
 
0
     @@default_content_type = "text/plain"
0
     cattr_accessor :default_content_type
0
-
0
+
0
     @@default_mime_version = "1.0"
0
     cattr_accessor :default_mime_version
0
 
0
@@ -291,47 +291,47 @@ module ActionMailer #:nodoc:
0
 
0
     # Specify the BCC addresses for the message
0
     adv_attr_accessor :bcc
0
-
0
+
0
     # Define the body of the message. This is either a Hash (in which case it
0
     # specifies the variables to pass to the template when it is rendered),
0
     # or a string, in which case it specifies the actual text of the message.
0
     adv_attr_accessor :body
0
-
0
+
0
     # Specify the CC addresses for the message.
0
     adv_attr_accessor :cc
0
-
0
+
0
     # Specify the charset to use for the message. This defaults to the
0
     # +default_charset+ specified for ActionMailer::Base.
0
     adv_attr_accessor :charset
0
-
0
+
0
     # Specify the content type for the message. This defaults to <tt>text/plain</tt>
0
     # in most cases, but can be automatically set in some situations.
0
     adv_attr_accessor :content_type
0
-
0
+
0
     # Specify the from address for the message.
0
     adv_attr_accessor :from
0
-
0
+
0
     # Specify additional headers to be added to the message.
0
     adv_attr_accessor :headers
0
-
0
+
0
     # Specify the order in which parts should be sorted, based on content-type.
0
     # This defaults to the value for the +default_implicit_parts_order+.
0
     adv_attr_accessor :implicit_parts_order
0
-
0
+
0
     # Defaults to "1.0", but may be explicitly given if needed.
0
     adv_attr_accessor :mime_version
0
-
0
+
0
     # The recipient addresses for the message, either as a string (for a single
0
     # address) or an array (for multiple addresses).
0
     adv_attr_accessor :recipients
0
-
0
+
0
     # The date on which the message was sent. If not set (the default), the
0
     # header will be set by the delivery agent.
0
     adv_attr_accessor :sent_on
0
-
0
+
0
     # Specify the subject of the message.
0
     adv_attr_accessor :subject
0
-
0
+
0
     # Specify the template name to use for current message. This is the "base"
0
     # template name, without the extension or directory, and may be used to
0
     # have multiple mailer methods share the same template.
0
@@ -347,7 +347,7 @@ module ActionMailer #:nodoc:
0
         self.class.mailer_name
0
       end
0
     end
0
-
0
+
0
     def mailer_name=(value)
0
       self.class.mailer_name = value
0
     end
0
@@ -425,7 +425,7 @@ module ActionMailer #:nodoc:
0
     # remain uninitialized (useful when you only need to invoke the "receive"
0
     # method, for instance).
0
     def initialize(method_name=nil, *parameters) #:nodoc:
0
- create!(method_name, *parameters) if method_name
0
+ create!(method_name, *parameters) if method_name
0
     end
0
 
0
     # Initialize the mailer via the given +method_name+. The body will be
0
@@ -511,7 +511,7 @@ module ActionMailer #:nodoc:
0
         @content_type ||= @@default_content_type.dup
0
         @implicit_parts_order ||= @@default_implicit_parts_order.dup
0
         @template ||= method_name
0
- @mailer_name ||= Inflector.underscore(self.class.name)
0
+ @mailer_name ||= self.class.name.underscore
0
         @parts ||= []
0
         @headers ||= {}
0
         @body ||= {}
0
@@ -597,7 +597,7 @@ module ActionMailer #:nodoc:
0
             part = (TMail::Mail === p ? p : p.to_mail(self))
0
             m.parts << part
0
           end
0
-
0
+
0
           if real_content_type =~ /multipart/
0
             ctype_attrs.delete "charset"
0
             m.set_content_type(real_content_type, nil, ctype_attrs)
0
@@ -612,7 +612,7 @@ module ActionMailer #:nodoc:
0
         mail.ready_to_send
0
         sender = mail['return-path'] || mail.from
0
 
0
- Net::SMTP.start(smtp_settings[:address], smtp_settings[:port], smtp_settings[:domain],
0
+ Net::SMTP.start(smtp_settings[:address], smtp_settings[:port], smtp_settings[:domain],
0
             smtp_settings[:user_name], smtp_settings[:password], smtp_settings[:authentication]) do |smtp|
0
           smtp.sendmail(mail.encoded, sender, destinations)
0
         end
...
28
29
30
31
 
32
33
34
...
40
41
42
43
 
44
45
46
...
94
95
96
97
98
 
...
28
29
30
 
31
32
33
34
...
40
41
42
 
43
44
45
46
...
94
95
96
 
97
98
0
@@ -28,7 +28,7 @@ module ActionController #:nodoc:
0
     # class ListsController < ApplicationController
0
     # caches_action :index, :show, :public, :feed
0
     # cache_sweeper OpenBar::Sweeper, :only => [ :edit, :destroy, :share ]
0
- # end
0
+ # end
0
     module Sweeping
0
       def self.included(base) #:nodoc:
0
         base.extend(ClassMethods)
0
@@ -40,7 +40,7 @@ module ActionController #:nodoc:
0
 
0
           sweepers.each do |sweeper|
0
             ActiveRecord::Base.observers << sweeper if defined?(ActiveRecord) and defined?(ActiveRecord::Base)
0
- sweeper_instance = (sweeper.is_a?(Symbol) ? Object.const_get(Inflector.classify(sweeper)) : sweeper).instance
0
+ sweeper_instance = (sweeper.is_a?(Symbol) ? Object.const_get(sweeper.to_s.classify) : sweeper).instance
0
 
0
             if sweeper_instance.is_a?(Sweeper)
0
               around_filter(sweeper_instance, :only => configuration[:only])
0
@@ -94,4 +94,4 @@ module ActionController #:nodoc:
0
       end
0
     end
0
   end
0
-end
0
\ No newline at end of file
0
+end
...
438
439
440
441
 
442
443
444
445
 
446
447
448
...
526
527
528
529
 
530
531
532
...
538
539
540
541
 
542
543
544
545
546
547
 
548
549
550
...
591
592
593
594
595
 
 
596
597
 
598
599
600
...
620
621
622
623
 
624
625
626
...
1027
1028
1029
1030
 
1031
1032
 
1033
1034
1035
...
1302
1303
1304
1305
 
1306
1307
1308
...
1312
1313
1314
1315
 
1316
1317
1318
1319
1320
 
1321
1322
1323
...
1570
1571
1572
1573
1574
 
 
1575
1576
1577
...
1620
1621
1622
1623
 
1624
1625
1626
...
1633
1634
1635
1636
 
1637
1638
1639
...
2133
2134
2135
2136
 
2137
2138
2139
2140
2141
2142
2143
 
2144
2145
2146
...
2174
2175
2176
2177
 
2178
2179
2180
...
2496
2497
2498
2499
 
2500
2501
2502
...
438
439
440
 
441
442
443
444
 
445
446
447
448
...
526
527
528
 
529
530
531
532
...
538
539
540
 
541
542
543
544
545
546
 
547
548
549
550
...
591
592
593
 
 
594
595
596
 
597
598
599
600
...
620
621
622
 
623
624
625
626
...
1027
1028
1029
 
1030
1031
 
1032
1033
1034
1035
...
1302
1303
1304
 
1305
1306
1307
1308
...
1312
1313
1314
 
1315
1316
1317
1318
1319
 
1320
1321
1322
1323
...
1570
1571
1572
 
 
1573
1574
1575
1576
1577
...
1620
1621
1622
 
1623
1624
1625
1626
...
1633
1634
1635
 
1636
1637
1638
1639
...
2133
2134
2135
 
2136
2137
2138
2139
2140
2141
2142
 
2143
2144
2145
2146
...
2174
2175
2176
 
2177
2178
2179
2180
...
2496
2497
2498
 
2499
2500
2501
2502
0
@@ -438,11 +438,11 @@ module ActiveRecord #:nodoc:
0
     # adapters for, e.g., your development and test environments.
0
     cattr_accessor :schema_format , :instance_writer => false
0
     @@schema_format = :ruby
0
-
0
+
0
     # Determine whether to store the full constant name including namespace when using STI
0
     superclass_delegating_accessor :store_full_sti_class
0
     self.store_full_sti_class = false
0
-
0
+
0
     class << self # Class methods
0
       # Find operates with four different retrieval approaches:
0
       #
0
@@ -526,7 +526,7 @@ module ActiveRecord #:nodoc:
0
           else find_from_ids(args, options)
0
         end
0
       end
0
-
0
+
0
       # This is an alias for find(:first). You can pass in all the same arguments to this method as you can
0
       # to find(:first)
0
       def first(*args)
0
@@ -538,13 +538,13 @@ module ActiveRecord #:nodoc:
0
       def last(*args)
0
         find(:last, *args)
0
       end
0
-
0
+
0
       # This is an alias for find(:all). You can pass in all the same arguments to this method as you can
0
       # to find(:all)
0
       def all(*args)
0
         find(:all, *args)
0
       end
0
-
0
+
0
       #
0
       # Executes a custom sql query against your database and returns all the results. The results will
0
       # be returned as an array with columns requested encapsulated as attributes of the model you call
0
@@ -591,10 +591,10 @@ module ActiveRecord #:nodoc:
0
       def exists?(id_or_conditions)
0
         connection.select_all(
0
           construct_finder_sql(
0
- :select => "#{quoted_table_name}.#{primary_key}",
0
- :conditions => expand_id_conditions(id_or_conditions),
0
+ :select => "#{quoted_table_name}.#{primary_key}",
0
+ :conditions => expand_id_conditions(id_or_conditions),
0
             :limit => 1
0
- ),
0
+ ),
0
           "#{name} Exists"
0
         ).size > 0
0
       end
0
@@ -620,7 +620,7 @@ module ActiveRecord #:nodoc:
0
       # # Creating an Array of new objects using a block, where the block is executed for each object:
0
       # User.create([{ :first_name => 'Jamie' }, { :first_name => 'Jeremy' }]) do |u|
0
       # u.is_admin = false
0
- # end
0
+ # end
0
       def create(attributes = nil, &block)
0
         if attributes.is_a?(Array)
0
           attributes.collect { |attr| create(attr, &block) }
0
@@ -1027,9 +1027,9 @@ module ActiveRecord #:nodoc:
0
         key = 'id'
0
         case primary_key_prefix_type
0
           when :table_name
0
- key = Inflector.foreign_key(base_name, false)
0
+ key = base_name.to_s.foreign_key(false)
0
           when :table_name_with_underscore
0
- key = Inflector.foreign_key(base_name)
0
+ key = base_name.to_s.foreign_key
0
         end
0
         key
0
       end
0
@@ -1302,7 +1302,7 @@ module ActiveRecord #:nodoc:
0
             scoped_order = reverse_sql_order(scope(:find, :order))
0
             scoped_methods.select { |s| s[:find].update(:order => scoped_order) }
0
           end
0
-
0
+
0
           find_initial(options.merge({ :order => order }))
0
         end
0
 
0
@@ -1312,12 +1312,12 @@ module ActiveRecord #:nodoc:
0
               s.gsub!(/\s(asc|ASC)$/, ' DESC')
0
             elsif s.match(/\s(desc|DESC)$/)
0
               s.gsub!(/\s(desc|DESC)$/, ' ASC')
0
- elsif !s.match(/\s(asc|ASC|desc|DESC)$/)
0
+ elsif !s.match(/\s(asc|ASC|desc|DESC)$/)
0
               s.concat(' DESC')
0
             end
0
           }.join(',')
0
         end
0
-
0
+
0
         def find_every(options)
0
           include_associations = merge_includes(scope(:find, :include), options[:include])
0
 
0
@@ -1570,8 +1570,8 @@ module ActiveRecord #:nodoc:
0
 
0
         # Guesses the table name, but does not decorate it with prefix and suffix information.
0
         def undecorated_table_name(class_name = base_class.name)
0
- table_name = Inflector.underscore(Inflector.demodulize(class_name))
0
- table_name = Inflector.pluralize(table_name) if pluralize_table_names
0
+ table_name = class_name.to_s.demodulize.underscore
0
+ table_name = table_name.pluralize if pluralize_table_names
0
           table_name
0
         end
0
 
0
@@ -1620,7 +1620,7 @@ module ActiveRecord #:nodoc:
0
             self.class_eval %{
0
               def self.#{method_id}(*args)
0
                 guard_protected_attributes = false
0
-
0
+
0
                 if args[0].is_a?(Hash)
0
                   guard_protected_attributes = true
0
                   attributes = args[0].with_indifferent_access
0
@@ -1633,7 +1633,7 @@ module ActiveRecord #:nodoc:
0
                 set_readonly_option!(options)
0
 
0
                 record = find_initial(options)
0
-
0
+
0
                  if record.nil?
0
                   record = self.new { |r| r.send(:attributes=, attributes, guard_protected_attributes) }
0
                   #{'yield(record) if block_given?'}
0
@@ -2133,14 +2133,14 @@ module ActiveRecord #:nodoc:
0
         # We can't use alias_method here, because method 'id' optimizes itself on the fly.
0
         (id = self.id) ? id.to_s : nil # Be sure to stringify the id for routes
0
       end
0
-
0
+
0
       # Returns a cache key that can be used to identify this record. Examples:
0
       #
0
       # Product.new.cache_key # => "products/new"
0
       # Product.find(5).cache_key # => "products/5" (updated_at not available)
0
       # Person.find(5).cache_key # => "people/5-20071224150000" (updated_at available)
0
       def cache_key
0
- case
0
+ case
0
         when new_record?
0
           "#{self.class.name.tableize}/new"
0
         when self[:updated_at]
0
@@ -2174,7 +2174,7 @@ module ActiveRecord #:nodoc:
0
       # Note: If your model specifies any validations then the method declaration dynamically
0
       # changes to:
0
       # save(perform_validation=true)
0
- # Calling save(false) saves the model without running validations.
0
+ # Calling save(false) saves the model without running validations.
0
       # See ActiveRecord::Validations for more information.
0
       def save
0
         create_or_update
0
@@ -2496,7 +2496,7 @@ module ActiveRecord #:nodoc:
0
       # Message class in that example.
0
       def ensure_proper_type
0
         unless self.class.descends_from_active_record?
0
- write_attribute(self.class.inheritance_column, store_full_sti_class ? self.class.name : Inflector.demodulize(self.class.name))
0
+ write_attribute(self.class.inheritance_column, store_full_sti_class ? self.class.name : self.class.name.demodulize)
0
         end
0
       end
0
 
...
197
198
199
200
 
201
202
 
203
204
205
206
207
208
 
209
210
211
212
213
 
214
215
216
...
730
731
732
733
 
734
735
736
...
854
855
856
857
 
858
859
860
861
862
863
864
 
865
866
867
...
197
198
199
 
200
201
 
202
203
204
205
206
207
 
208
209
210
211
212
 
213
214
215
216
...
730
731
732
 
733
734
735
736
...
854
855
856
 
857
858
859
860
861
862
863
 
864
865
866
867
0
@@ -197,20 +197,20 @@ end
0
 # class FooTest < ActiveSupport::TestCase
0
 # self.use_transactional_fixtures = true
0
 # self.use_instantiated_fixtures = false
0
-#
0
+#
0
 # fixtures :foos
0
-#
0
+#
0
 # def test_godzilla
0
 # assert !Foo.find(:all).empty?
0
 # Foo.destroy_all
0
 # assert Foo.find(:all).empty?
0
 # end
0
-#
0
+#
0
 # def test_godzilla_aftermath
0
 # assert !Foo.find(:all).empty?
0
 # end
0
 # end
0
-#
0
+#
0
 # If you preload your test database with all fixture data (probably in the Rakefile task) and use transactional fixtures,
0
 # then you may omit all fixtures declarations in your test cases since all the data's already there and every case rolls back its changes.
0
 #
0
@@ -730,7 +730,7 @@ class Fixtures < (RUBY_VERSION < '1.9' ? YAML::Omap : Hash)
0
       reader.each do |row|
0
         data = {}
0
         row.each_with_index { |cell, j| data[header[j].to_s.strip] = cell.to_s.strip }
0
- self["#{Inflector::underscore(@class_name)}_#{i+=1}"] = Fixture.new(data, model_class)
0
+ self["#{@class_name.to_s.underscore}_#{i+=1}"] = Fixture.new(data, model_class)
0
       end
0
     end
0
 
0
@@ -854,14 +854,14 @@ module Test #:nodoc:
0
           require_dependency file_name
0
         rescue LoadError => e
0
           # Let's hope the developer has included it himself
0
-
0
+
0
           # Let's warn in case this is a subdependency, otherwise
0
           # subdependency error messages are totally cryptic
0
           if ActiveRecord::Base.logger
0
             ActiveRecord::Base.logger.warn("Unable to load #{file_name}, underlying cause #{e.message} \n\n #{e.backtrace.join("\n")}")
0
           end
0
         end
0
-
0
+
0
         def require_fixture_classes(table_names = nil)
0
           (table_names || fixture_table_names).each do |table_name|
0
             file_name = table_name.to_s

Comments

    No one has commented yet.