Skip to content
Browse files

Revert to rails 3.0.5, there have some bug in Rails 3.0.9

  • Loading branch information...
1 parent 1920257 commit 678b4983f12239c40dcf434b96e6dc85662b5036 @huacnlee committed Aug 16, 2011
Showing with 39 additions and 38 deletions.
  1. +1 −1 Gemfile
  2. +31 −33 Gemfile.lock
  3. +6 −3 app/helpers/application_helper.rb
  4. +1 −1 app/helpers/asks_helper.rb
View
2 Gemfile
@@ -1,5 +1,5 @@
source 'http://rubygems.org'
-gem 'rails', '3.0.9'
+gem 'rails', '3.0.5'
# MongoDB
gem "mongoid", "2.0.0"
View
64 Gemfile.lock
@@ -9,32 +9,32 @@ GEM
specs:
aaronh-chronic (0.3.9)
abstract (1.0.0)
- actionmailer (3.0.9)
- actionpack (= 3.0.9)
- mail (~> 2.2.19)
- actionpack (3.0.9)
- activemodel (= 3.0.9)
- activesupport (= 3.0.9)
+ actionmailer (3.0.5)
+ actionpack (= 3.0.5)
+ mail (~> 2.2.15)
+ actionpack (3.0.5)
+ activemodel (= 3.0.5)
+ activesupport (= 3.0.5)
builder (~> 2.1.2)
erubis (~> 2.6.6)
- i18n (~> 0.5.0)
+ i18n (~> 0.4)
rack (~> 1.2.1)
- rack-mount (~> 0.6.14)
+ rack-mount (~> 0.6.13)
rack-test (~> 0.5.7)
tzinfo (~> 0.3.23)
- activemodel (3.0.9)
- activesupport (= 3.0.9)
+ activemodel (3.0.5)
+ activesupport (= 3.0.5)
builder (~> 2.1.2)
- i18n (~> 0.5.0)
- activerecord (3.0.9)
- activemodel (= 3.0.9)
- activesupport (= 3.0.9)
- arel (~> 2.0.10)
+ i18n (~> 0.4)
+ activerecord (3.0.5)
+ activemodel (= 3.0.5)
+ activesupport (= 3.0.5)
+ arel (~> 2.0.2)
tzinfo (~> 0.3.23)
- activeresource (3.0.9)
- activemodel (= 3.0.9)
- activesupport (= 3.0.9)
- activesupport (3.0.9)
+ activeresource (3.0.5)
+ activemodel (= 3.0.5)
+ activesupport (= 3.0.5)
+ activesupport (3.0.5)
addressable (2.2.6)
arel (2.0.10)
aws-ses (0.4.2)
@@ -65,7 +65,7 @@ GEM
addressable (~> 2.2.4)
multipart-post (~> 1.1.0)
rack (>= 1.1.0, < 2)
- i18n (0.5.0)
+ i18n (0.6.0)
json (1.4.6)
juggernaut (2.0.3)
redis
@@ -150,23 +150,21 @@ GEM
ruby-openid (>= 2.1.8)
rack-test (0.5.7)
rack (>= 1.0)
- rails (3.0.9)
- actionmailer (= 3.0.9)
- actionpack (= 3.0.9)
- activerecord (= 3.0.9)
- activeresource (= 3.0.9)
- activesupport (= 3.0.9)
+ rails (3.0.5)
+ actionmailer (= 3.0.5)
+ actionpack (= 3.0.5)
+ activerecord (= 3.0.5)
+ activeresource (= 3.0.5)
+ activesupport (= 3.0.5)
bundler (~> 1.0)
- railties (= 3.0.9)
+ railties (= 3.0.5)
rails-dev-boost-beta (0.1.2)
- railties (3.0.9)
- actionpack (= 3.0.9)
- activesupport (= 3.0.9)
+ railties (3.0.5)
+ actionpack (= 3.0.5)
+ activesupport (= 3.0.5)
rake (>= 0.8.7)
- rdoc (~> 3.4)
thor (~> 0.14.4)
rake (0.9.2)
- rdoc (3.9.2)
redis (2.1.1)
redis-namespace (1.0.3)
redis (< 3.0.0)
@@ -236,7 +234,7 @@ DEPENDENCIES
oa-openid (= 0.2.0)
omniauth (= 0.2.0)
omniauth_china (= 0.0.6)
- rails (= 3.0.9)
+ rails (= 3.0.5)
rails-dev-boost-beta (= 0.1.2)
redis (= 2.1.1)
redis-search (= 0.1)
View
9 app/helpers/application_helper.rb
@@ -88,9 +88,12 @@ def auto_link_urls(text, href_options = {}, options = {})
if a =~ /<a\s/i # don't replace URL's that are already linked
all
else
- text = ""
- text += b if !b.blank?
- text += c if !c.blank?
+ begin
+ text = b + c
+ rescue => e
+ Rails.logger.warn { "auto_link_urls faield text = b + c" }
+ end
+
text = yield(text) if block_given?
if(not limit.blank?)
text = truncate(text, :length => limit)
View
2 app/helpers/asks_helper.rb
@@ -25,7 +25,7 @@ def md_body(str)
return "" if str.blank?
# str = simple_format(str) if str =~ /\n/
# Rails.logger.info "str: #{str.inspect}"
- str = sanitize(str,:tags => %w(strong b i u strike s ol ul li blockquote address br div p), :attributes => %w(src))
+ str = sanitize(str,:tags => %w(strong b i u strike s ol ul li blockquote address br p), :attributes => %w(src))
str = auto_link_urls(str,{:target => "_blank", :rel => "nofollow" }, {:limit => 80 })
return raw str
end

1 comment on commit 678b498

@huobazi

能讲讲是那些bug吗,谢谢

Please sign in to comment.
Something went wrong with that request. Please try again.