Skip to content

Instantly share code, notes, and snippets.

@jonleighton
Created January 13, 2012 22:50
Show Gist options
  • Select an option

  • Save jonleighton/1609200 to your computer and use it in GitHub Desktop.

Select an option

Save jonleighton/1609200 to your computer and use it in GitHub Desktop.
def test_defining_attribute_methods_is_threadsafe
klass = Class.new(ActiveRecord::Base)
klass.table_name = "posts"
100.times.map { |i|
Thread.new { klass.define_attribute_methods }
}.join
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment