This project is archived and is in readonly mode.
create_table cannot be called without block
Reported by Joseph Wilk | March 12th, 2009 @ 01:26 PM | in 2.x
Testing against master and 2.3 rc-2
When create_table is called without a block it raises an error:
Person.connection.create_table(:test)
test_create_table_without_a_block(MigrationTest):
LocalJumpError: no block given
./test/cases/../../lib/active_record/connection_adapters/abstract/schema_statements.rb:104:in `create_table'
./test/cases/migration_test.rb:274:in `test_create_table_without_a_block'
./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in `__send__'
./test/cases/../../../activesupport/lib/active_support/testing/setup_and_teardown.rb:62:in `run'
Patch with test and fix attached.
Comments and changes to this ticket
-
Pratik June 21st, 2009 @ 08:00 PM
- Tag changed from 2.3-rc2, activerecord, bug, patch to 2.3, 2.3-rc2, activerecord, bug, patch
- State changed from new to resolved
Fixed in eb30e4ca40370b416566f1bbaf0204bb379883e4
-
Repository June 21st, 2009 @ 09:36 PM
(from [eb30e4ca40370b416566f1bbaf0204bb379883e4]) Fixed a bug where create_table could not be called without a block [#2221 state:resolved]
Signed-off-by: Pratik Naik pratiknaik@gmail.com
http://github.com/rails/rails/commit/eb30e4ca40370b416566f1bbaf0204... -
Repository June 23rd, 2009 @ 10:50 PM
(from [f2dda7b93c38a7fe5fc04930112e85a311b260e2]) Fixed a bug where create_table could not be called without a block [#2221 state:resolved]
Signed-off-by: Pratik Naik pratiknaik@gmail.com
http://github.com/rails/rails/commit/f2dda7b93c38a7fe5fc04930112e85... -
Rob Aldred July 14th, 2009 @ 05:15 PM
This bug is still present in AR 2.3.2
ActiveRecord::Base.connection.create_table(:foo) LocalJumpError: no block given
from /opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/schema_statements.rb:104:in `create_table' from /opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/mysql_adapter.rb:473:in `create_table' from (irb):9</code>
-
Pratik July 14th, 2009 @ 05:17 PM
It's fixed in 2-3-stable branch. You can use that branch or wait for 2.3.3 to come out.
-
Craig Buchek March 30th, 2010 @ 02:47 AM
- Tag changed from 2.3, 2.3-rc2, activerecord, bug, patch to 2.3, 2.3-rc2, 2.3-stable, activerecord, bug, patch
Hey, this commit never made it into 2.3.3, 2.3.4, 2.3.5, or even 2.3-stable! How the heck did that happen?
See line 104 in http://github.com/rails/rails/blame/v2.3.5/activerecord/lib/active_... or http://github.com/rails/rails/blob/2-3-stable/activerecord/lib/acti...
It'd be nice to have this in Rails 2.3.6 (will there be a 2.3.6 release?), but we can just work around it by adding an empty block.
But it's a bit scary to see that there's a broken process somewhere, where this commit went missing for 3 releases, and still isn't in 2.3-stable. Good to see that it is included in v3.0.0.beta1 and master at least.
-
Repository March 30th, 2010 @ 03:01 AM
(from [ea6ef768a7718f9b4733c7db5b0a49d57440a2d9]) Fixed a bug where create_table could not be called without a block [#2221 state:resolved]
Signed-off-by: Pratik Naik pratiknaik@gmail.com
http://github.com/rails/rails/commit/ea6ef768a7718f9b4733c7db5b0a49...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Tags
Referenced by
- 2221 create_table cannot be called without block (from [ea6ef768a7718f9b4733c7db5b0a49d57440a2d9]) Fixed a...
- 2221 create_table cannot be called without block (from [eb30e4ca40370b416566f1bbaf0204bb379883e4]) Fixed a...
- 2221 create_table cannot be called without block (from [f2dda7b93c38a7fe5fc04930112e85a311b260e2]) Fixed a...