Ticket #5706: colon_fix.diff
| File colon_fix.diff, 6.7 kB (added by bmitchell@backchannelmedia.com, 4 years ago) |
|---|
-
activesupport/lib/active_support/inflector.rb
old new 167 167 "#{number}th" 168 168 else 169 169 case number.to_i % 10 170 when 1 :"#{number}st"171 when 2 :"#{number}nd"172 when 3 :"#{number}rd"170 when 1; "#{number}st" 171 when 2; "#{number}nd" 172 when 3; "#{number}rd" 173 173 else "#{number}th" 174 174 end 175 175 end -
activerecord/lib/active_record/validations.rb
old new 258 258 # whether or not to validate the record. See #validates_each. 259 259 def evaluate_condition(condition, record) 260 260 case condition 261 when Symbol :record.send(condition)262 when String :eval(condition, binding)261 when Symbol; record.send(condition) 262 when String; eval(condition, binding) 263 263 else 264 264 if condition_block?(condition) 265 265 condition.call(record) -
activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
old new 97 97 # add_lock! 'SELECT * FROM suppliers', :lock => ' FOR UPDATE' 98 98 def add_lock!(sql, options) 99 99 case lock = options[:lock] 100 when true :sql << ' FOR UPDATE'101 when String :sql << " #{lock}"100 when true; sql << ' FOR UPDATE' 101 when String; sql << " #{lock}" 102 102 end 103 103 end 104 104 -
activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
old new 54 54 # This is false for all adapters but Firebird. 55 55 def prefetch_primary_key?(table_name = nil) 56 56 false 57 end 57 end 58 58 59 59 def reset_runtime #:nodoc: 60 60 rt, @runtime = @runtime, 0 -
activerecord/lib/active_record/connection_adapters/oracle_adapter.rb
old new 496 496 alias :define_a_column_pre_ar :define_a_column 497 497 def define_a_column(i) 498 498 case do_ocicall(@ctx) { @parms[i - 1].attrGet(OCI_ATTR_DATA_TYPE) } 499 when 8 :@stmt.defineByPos(i, String, 65535) # Read LONG values500 when 187 :@stmt.defineByPos(i, OraDate) # Read TIMESTAMP values499 when 8 ; @stmt.defineByPos(i, String, 65535) # Read LONG values 500 when 187 ; @stmt.defineByPos(i, OraDate) # Read TIMESTAMP values 501 501 when 108 502 502 if @parms[i - 1].attrGet(OCI_ATTR_TYPE_NAME) == 'XMLTYPE' 503 503 @stmt.defineByPos(i, String, 65535) -
activerecord/lib/active_record/base.rb
old new 1913 1913 1914 1914 def convert_number_column_value(value) 1915 1915 case value 1916 when FalseClass :01917 when TrueClass :11918 when '' :nil1916 when FalseClass; 0 1917 when TrueClass; 1 1918 when ''; nil 1919 1919 else value 1920 1920 end 1921 1921 end -
activerecord/lib/active_record/schema_dumper.rb
old new 54 54 @connection.tables.sort.each do |tbl| 55 55 next if ["schema_info", ignore_tables].flatten.any? do |ignored| 56 56 case ignored 57 when String :tbl == ignored58 when Regexp :tbl =~ ignored57 when String; tbl == ignored 58 when Regexp; tbl =~ ignored 59 59 else 60 60 raise StandardError, 'ActiveRecord::SchemaDumper.ignore_tables accepts an array of String and / or Regexp values.' 61 61 end -
actionpack/lib/action_view/helpers/number_helper.rb
old new 85 85 # human_size(1234567890) => 1.1 GB 86 86 def number_to_human_size(size) 87 87 case 88 when size == 1 :'1 Byte'89 when size < 1.kilobyte :'%d Bytes' % size90 when size < 1.megabyte :'%.1f KB' % (size / 1.0.kilobyte)91 when size < 1.gigabyte :'%.1f MB' % (size / 1.0.megabyte)92 when size < 1.terabyte :'%.1f GB' % (size / 1.0.gigabyte)88 when size == 1 ; '1 Byte' 89 when size < 1.kilobyte; '%d Bytes' % size 90 when size < 1.megabyte; '%.1f KB' % (size / 1.0.kilobyte) 91 when size < 1.gigabyte; '%.1f MB' % (size / 1.0.megabyte) 92 when size < 1.terabyte; '%.1f GB' % (size / 1.0.gigabyte) 93 93 else '%.1f TB' % (size / 1.0.terabyte) 94 94 end.sub('.0', '') 95 95 rescue -
actionpack/lib/action_view/base.rb
old new 383 383 def find_template_extension_for(template_path) 384 384 if match = delegate_template_exists?(template_path) 385 385 match.first.to_sym 386 elsif erb_template_exists?(template_path) ::rhtml387 elsif builder_template_exists?(template_path) ::rxml388 elsif javascript_template_exists?(template_path) ::rjs386 elsif erb_template_exists?(template_path); :rhtml 387 elsif builder_template_exists?(template_path); :rxml 388 elsif javascript_template_exists?(template_path); :rjs 389 389 else 390 390 raise ActionViewError, "No rhtml, rxml, rjs or delegate template found for #{template_path} in #{@base_path}" 391 391 end