hobo icon indicating copy to clipboard operation
hobo copied to clipboard

[#1007] target.new and target.build adds new empty element in collection...

Open adoyen opened this issue 12 years ago • 3 comments

Hi, As said in ticket 1007, this issue is not solved by using build. An empty element is still added to the collection when using a tag.

adoyen avatar Jun 20 '12 21:06 adoyen

Arnaud, can you send me a sample app or test case that demonstrate's the behaviour? Your patch causes one of the existing tests to fail, so we need to find a different solution.

Bryan

On Wed, Jun 20, 2012 at 5:07 PM, Arnaud Doyen [email protected] wrote:

Hi, As said in ticket 1007, this issue is not solved by using build. An empty element is still added to the collection when using a tag.

You can merge this Pull Request by running:

 git pull https://github.com/A-Kyma/hobo collection_empty_elem

Or you can view, comment on it, or merge it online at:

 https://github.com/tablatom/hobo/pull/44

-- Commit Summary --

  • [#1007] target.new and target.build adds new empty element in collection.

-- File Changes --

M hobo_rapid/taglibs/html/a.dryml (2)

-- Patch Links --

 https://github.com/tablatom/hobo/pull/44.patch  https://github.com/tablatom/hobo/pull/44.diff


Reply to this email directly or view it on GitHub: https://github.com/tablatom/hobo/pull/44

bryanlarsen avatar Jun 20 '12 21:06 bryanlarsen

Hi Bryan, I'll try to have an example application for that issue (if still exists). Sorry for the delay, I'm not full time at developping hobo application (it's more like a hobby than a real job and I don't have always time for that in the evening)

I keep you informed when I reproduce the issue on a small app.

adoyen avatar Sep 28 '12 13:09 adoyen

There was a change in Rails 3 such that calling (for instance) @blog.posts.new was exactly identical to calling @blog.posts.build - that would explain why this didn't show up on Hobo 1.0.

Haven't tried it, but isn't a case like this exactly why we add the new_candidate method to association collections? - https://github.com/tablatom/hobo/blob/master/hobo/lib/hobo/extensions/active_record/associations/collection.rb#L13

al2o3cr avatar Sep 28 '12 14:09 al2o3cr