fix block.arity will raise nil error #8640

Merged
merged 1 commit into from Jan 2, 2013

Conversation

Projects
None yet
2 participants
@jasl
Contributor

jasl commented Dec 28, 2012

content_tag_for will raise nil:NilClass when not given a block, cause content_tag_for_single_record will check block.arity == 0 but in this case "block" should be nil obviously.

@rafaelfranca

This comment has been minimized.

Show comment
Hide comment
@rafaelfranca

rafaelfranca Dec 28, 2012

Member

Could you add a test case?

Member

rafaelfranca commented Dec 28, 2012

Could you add a test case?

@jasl

This comment has been minimized.

Show comment
Hide comment
@jasl

jasl Dec 29, 2012

Contributor

ok I‘ll do it later

Contributor

jasl commented Dec 29, 2012

ok I‘ll do it later

@jasl

This comment has been minimized.

Show comment
Hide comment
@jasl

jasl Dec 29, 2012

Contributor

@rafaelfranca
I add test case
sorry in last commit I do something wrong
now content_tag_for without given block works as mentioned in document

Contributor

jasl commented Dec 29, 2012

@rafaelfranca
I add test case
sorry in last commit I do something wrong
now content_tag_for without given block works as mentioned in document

+ expected = %(<li class="record_tag_post" id="record_tag_post_101"></li>\n<li class="record_tag_post" id="record_tag_post_102"></li>)
+ actual = content_tag_for(:li, [post_1, post_2])
+ assert_dom_equal expected, actual
+

This comment has been minimized.

@rafaelfranca

rafaelfranca Jan 1, 2013

Member

Remove this blank line

@rafaelfranca

rafaelfranca Jan 1, 2013

Member

Remove this blank line

@rafaelfranca

This comment has been minimized.

Show comment
Hide comment
@rafaelfranca

rafaelfranca Jan 1, 2013

Member

Seems good. Could you add a CHANGELOG entry?

Member

rafaelfranca commented Jan 1, 2013

Seems good. Could you add a CHANGELOG entry?

@rafaelfranca

This comment has been minimized.

Show comment
Hide comment
@rafaelfranca

rafaelfranca Jan 1, 2013

Member

And please squash your commits

Member

rafaelfranca commented Jan 1, 2013

And please squash your commits

@jasl

This comment has been minimized.

Show comment
Hide comment
@jasl

jasl Jan 2, 2013

Contributor

@rafaelfranca
what about now?
sry, this my first commit to a open source project.

Contributor

jasl commented Jan 2, 2013

@rafaelfranca
what about now?
sry, this my first commit to a open source project.

rafaelfranca added a commit that referenced this pull request Jan 2, 2013

Merge pull request #8640 from jasl/3-2-stable
fix block.arity will raise nil error

@rafaelfranca rafaelfranca merged commit 204109e into rails:3-2-stable Jan 2, 2013

@rafaelfranca

This comment has been minimized.

Show comment
Hide comment
@rafaelfranca

rafaelfranca Jan 2, 2013

Member

Very good. Thank you so much.

Member

rafaelfranca commented Jan 2, 2013

Very good. Thank you so much.

rafaelfranca added a commit that referenced this pull request Jan 2, 2013

Make content_tag_for work without block
This is version of #8640 for master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment