Permalink
Browse files

Fixed SQL Server test #1678 [Tom Ward]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1782 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 32a8007 commit 14f06c2cc1248facaa233a6d8df6cd1d9501168c @dhh dhh committed Jul 9, 2005
@@ -113,7 +113,7 @@ def simple_format(text)
text.gsub!(/\n\n/, '</p>\0<p>') # turn two newlines into paragraph
text.gsub!(/([^\n])(\n)([^\n])/, '\1\2<br />\3') # turn single newline into <br />
- return '<p>' + text + '</p>' # wrap the first and last line in paragraphs before we're done
+ content_tag("p", text)
end
# Turns all urls and email addresses into clickable links. The +link+ parameter can limit what should be linked.
@@ -66,7 +66,7 @@ def type_cast(value)
return nil if value.nil? || value =~ /^\s*null\s*$/i
case type
when :string then value
- when :integer then value == true || value == false ? value == true ? '1' : '0' : value.to_i
+ when :integer then value == true || value == false ? value == true ? 1 : 0 : value.to_i
when :float then value.to_f
when :datetime then cast_to_datetime(value)
when :timestamp then cast_to_time(value)
View
@@ -189,5 +189,5 @@ end
desc "Migrate the database according to the migrate scripts in db/migrate (only supported on PG/MySQL). A specific version can be targetted with VERSION=x"
task :migrate => :environment do
- ActiveRecord::Migrator.migrate(File.dirname(__FILE__) + '/db/migrate/', ENV["VERSION"])
+ ActiveRecord::Migrator.migrate(File.dirname(__FILE__) + '/db/migrate/', ENV["VERSION"] ? ENV["VERSION"].to_i : nil)
end

0 comments on commit 14f06c2

Please sign in to comment.