Skip to content

The builder object sometimes loses the custom_namespace attribute in threadsafe mode #998 #1003

Closed
wants to merge 6 commits into from
View
16 .travis.yml 100644 → 100755
@@ -2,13 +2,8 @@ before_install:
- gem update --system
- gem update bundler
rvm:
- - 1.8.7
- - ree
- - 1.9.2
- - 1.9.3
+ - jruby-19mode
gemfile:
- - gemfiles/rails_3.0.gemfile
- - gemfiles/rails_3.1.gemfile
- gemfiles/rails_3.2.gemfile
env:
- DEFER_GC=false RAILS_EDGE=true
@@ -18,19 +13,10 @@ matrix:
- rvm: 1.9.3
gemfile: gemfiles/rails_4.gemfile
env: DEFER_GC=false RAILS_EDGE=true
- - rvm: 2.0.0
- gemfile: gemfiles/rails_4.gemfile
- env: DEFER_GC=false RAILS_EDGE=true
- rvm: 1.9.3
gemfile: gemfiles/rails_edge.gemfile
env: DEFER_GC=false RAILS_EDGE=true
- - rvm: 2.0.0
- gemfile: gemfiles/rails_edge.gemfile
- env: DEFER_GC=false RAILS_EDGE=true
allow_failures:
- rvm: 1.9.3
gemfile: gemfiles/rails_edge.gemfile
env: DEFER_GC=false RAILS_EDGE=true
- - rvm: 2.0.0
- gemfile: gemfiles/rails_edge.gemfile
- env: DEFER_GC=false RAILS_EDGE=true
View
15 spec/helpers/form_helper_spec.rb
@@ -192,6 +192,19 @@ class MyAwesomeCustomBuilder < Formtastic::FormBuilder
end
end
end
+
+ describe "Threaded Form Building" do
+ it "creates forms and adds an input in a threaded environment" do
+ threads = Array.new(1000).map{ Thread.new{create_form()} }
+ threads.map{ |t| t.join }
+ end
-end
+ # Create the semantic form. Create the author input
+ def create_form
+ semantic_form_for(@new_post, :url => '/hello') do |builder|
+ input = builder.input :author
+ end
+ end
+ end
+end
Something went wrong with that request. Please try again.