Skip to content

Loading…

fix error for calling 'create_table' without block #107

Merged
merged 1 commit into from

2 participants

@virtax

create_table can be used for creating table without columns. 
For example, this is used in the mini_record gem.

Dmitriy Partsyrniy fix AbstractAdapter.create_table when a block isn't provided
create_table can be used for creating table without columns. 
For example, this is used in the mini_record gem.
766ba16
@matthuhiggins matthuhiggins merged commit c6c506b into matthuhiggins:master

1 check passed

Details default The Travis build passed
@virtax

Hi!
I have installed the 1.4.1 gem version and can't find my fix in the gem sources.
Maybe something wrong with gem buidling? Can you please check it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 29, 2013
  1. fix AbstractAdapter.create_table when a block isn't provided

    Dmitriy Partsyrniy committed
    create_table can be used for creating table without columns. 
    For example, this is used in the mini_record gem.
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/foreigner/connection_adapters/abstract/schema_statements.rb
View
2 lib/foreigner/connection_adapters/abstract/schema_statements.rb
@@ -13,7 +13,7 @@ def create_table(table_name, *args, &block)
definition = nil
super do |td|
definition = td # This is my trick to get the definition
- block.call(td)
+ block.call(td) unless block.nil?
end
definition.foreign_keys.each do |to_table, options_list|
options_list.each do |options|
Something went wrong with that request. Please try again.