Groups
Groups
Sign in
Groups
Groups
Ruby on Rails: Talk
Conversations
About
Send feedback
Help
question on 'create_table' with limit option
15 views
Skip to first unread message
Jin Xie
unread,
Oct 16, 2014, 7:49:27 AM
10/16/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rubyonra...@googlegroups.com
at this method(
https://github.com/rails/rails/blob/08754f12e65a9ec79633a605e986d0f1ffa4b251/activerecord/lib/active_record/schema_migration.rb#L24
)
limit is default to `nil` which mean it is optional argument, and few lines down `version_options` only adds limit when the limit is passed from the argument.
and in this method(
https://github.com/rails/rails/blob/08754f12e65a9ec79633a605e986d0f1ffa4b251/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb#L241
) pass on the options to `new_column_definition `, and this `new_column_definition` method(
https://github.com/rails/rails/blob/08754f12e65a9ec79633a605e986d0f1ffa4b251/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb#L295
) will try to `fetch(:limit)` which will raise exception.
Am wondering had I missing something ?
Colin Law
unread,
Oct 16, 2014, 9:11:27 AM
10/16/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rubyonra...@googlegroups.com
If fetch does not find the key then it runs the block.
http://ruby-doc.org/core-2.1.3/Hash.html#method-i-fetch
Colin
Reply all
Reply to author
Forward
0 new messages