[FIX] 'agility' tutorial has minor glitch in edge hobo
Reported by Mathijs Kwik | July 22nd, 2008 @ 12:03 AM
I'm not sure if reporting edge errors here is appropriate, if it's not, please tell me.
Since the 'agility' app was done using edge hobo (or at least it doesn't fully work on 0.7.5), I thought I'dd report it here, so the documentation stays in sync with the current code.
I don't know if the documentation should be fixed(ie edge broke the old way of doing things) or there's a bug in edge.
this part:
<show-page>
<content-body:>
<h2><Your/> Assigned Tasks</h2>
<repeat with="&@user.tasks.group_by(&:story)">
<h3><a with="&this_key"/></h3>
<collection class="tasks"/>
</repeat>
</content-body:>
</show-page>
breaks on the tasks collection. somehow 'this' is not available anymore.
NoMethodError in Users#show
Showing users/show.dryml where line #6 raised:
You have a nil object when you didn't expect it!
The error occurred while evaluating nil.origin_attribute
Extracted source (around line #6):
3: <h2><Your/> Assigned Tasks</h2>
4: <repeat with="&@user.tasks.group_by(&:story)">
5: <h3><a with="&this_key"/></h3>
6: <collection class="tasks"/>
7: </repeat>
8: </content-body:>
9: </show-page>
RAILS_ROOT: /mnt/data/projects/agility
Application Trace | Framework Trace | Full Trace
vendor/plugins/hobo/taglibs/rapid_generics.dryml:82:in `base_collection'
vendor/plugins/hobo/lib/hobo/dryml/template_environment.rb:273:in `_tag_context'
vendor/plugins/hobo/lib/hobo/dryml/template_environment.rb:232:in `new_context'
vendor/plugins/hobo/lib/hobo/dryml/template_environment.rb:273:in `_tag_context'
vendor/plugins/hobo/taglibs/rapid_generics.dryml:72:in `base_collection'
vendor/plugins/hobo/taglibs/rapid_generics.dryml:61:in `collection'
vendor/plugins/hobo/lib/hobo/dryml/scoped_variables.rb:20:in `new_scope'
vendor/plugins/hobo/taglibs/rapid_generics.dryml:59:in `collection'
vendor/plugins/hobo/lib/hobo/dryml/template_environment.rb:273:in `_tag_context'
vendor/plugins/hobo/lib/hobo/dryml/template_environment.rb:232:in `new_context'
vendor/plugins/hobo/lib/hobo/dryml/template_environment.rb:273:in `_tag_context'
vendor/plugins/hobo/taglibs/rapid_generics.dryml:58:in `collection'
app/views/users/show.dryml:6:in `render_page'
app/views/users/show.dryml:4:in `render_page'
app/views/users/show.dryml:4:in `render_page'
app/views/users/show.dryml:2:in `render_page'
app/views/taglibs/themes/clean/clean.dryml:2:in `page'
app/views/taglibs/themes/clean/clean.dryml:1:in `page'
app/views/users/show.dryml:1:in `render_page'
app/views/users/show.dryml:1:in `render_page'
Comments and changes to this ticket
-
Mathijs Kwik July 22nd, 2008 @ 09:14 PM
- Title changed from 'agility' tutorial has minor glitch in edge hobo to [FIX] 'agility' tutorial has minor glitch in edge hobo
Rails 2.0.2 changed to OrderedHash for group_by, so this should fix it.
http://github.com/rails/rails/co...
diff --git a/hobo/lib/hobo/hobo_helper.rb b/hobo/lib/hobo/hobo_helper.rb index 7622cb5..6e0c232 100644 --- a/hobo/lib/hobo/hobo_helper.rb +++ b/hobo/lib/hobo/hobo_helper.rb @@ -150,7 +150,7 @@ module Hobo def map_this res = [] empty = true - if this.is_a?(Hash) + if this.is_a?(Hash, ActiveSupport::OrderedHash) this.map do |key, value| empty = false; self.this_key = key;
-
Mathijs Kwik July 25th, 2008 @ 02:08 AM
Oops, it wasn't fixed by that commit.
But a fix for it is included in my github-fork
-
Tom Locke July 28th, 2008 @ 07:52 PM
- State changed from new to resolved
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป