Ramaze 2011.07.25 User helper bug

7 views
Skip to first unread message

John

unread,
Aug 10, 2011, 1:09:23 PM8/10/11
to Ramaze
hi I just upgraded to 2011.07.25 (innate 2011.04) and realised my user
helper related code was broken in funny ways. As It appears it was
down to resolving the helper itself.

Apparently the helper module named UserHelper though the name given in
the namespace is stil 'user'. In 2010 versions the lines below matched
(i.e User and user as opposed to UserHeper and user)

https://github.com/Ramaze/ramaze/blob/master/lib/ramaze/helper/user.rb#L98
https://github.com/Ramaze/ramaze/blob/master/lib/ramaze/helper/user.rb#L100

When changing line 98 to 'User' from 'UserHelper' everything started
working again.

Could it be my setup that possibly messes somehow the resolution (due
to older gems) or is it a genuine bug?

any ideas?

(I'm still using Ruby 1.9.1p378, RubyGems 1.3.5, Rack 1.2.1 btw)
/pagojo
ps btw what is the safest way of updating Ramaze with all of it deps?

Yorick Peterse

unread,
Aug 10, 2011, 1:35:35 PM8/10/11
to ram...@googlegroups.com
John,

I've taken a quick look at the helper but I doubt this is the actual cause of 
the problem. The reason the helper is named UserHelper and not User is because
the latter is a common name for models (and other general classes). I also think
that if this were to be an actual bug in Ramaze more people would've reported it
as the helper is quite popular as far as I can tell. Is it possible for you to
supply a small test case that reproduces the error?

About the upgrading, I personally think the safest way to upgrade Ramaze is to
do it in a separate RVM gemset and merge it once everything is working again. If
you're using a VCS similar to Git I also recommend doing it on a separate branch
so you can easily revert your changes.

Yorick


--
You received this message because you are subscribed to the Google Groups "Ramaze" group.
To post to this group, send email to ram...@googlegroups.com.
To unsubscribe from this group, send email to ramaze+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ramaze?hl=en.


John

unread,
Aug 10, 2011, 5:46:48 PM8/10/11
to Ramaze


On Aug 10, 6:35 pm, Yorick Peterse <yorickpete...@gmail.com> wrote:
> John,
>
> I've taken a quick look at the helper but I doubt this is the actual cause of
> the problem. The reason the helper is named UserHelper and not User is
> because the latter is a common name for models (and other general classes). I also
> think that if this were to be an actual bug in Ramaze more people would've
> reported it as the helper is quite popular as far as I can tell.

This is what I thought, but I can't argue with what I'm seeing over
here. The above line change fixed everything :-/

I sort of have the hunch that you are right, but I'd like to find out
really why so.

> Is it possible for you
> to supply a small test case that reproduces the error?
>

I think I better do that

btw is there an easy way to find out which helpers are loaded with
their respective load paths?

> About the upgrading, I personally think the safest way to upgrade Ramaze is
> to do it in a separate RVM gemset and merge it once everything is working
> again. If you're using a VCS similar to Git I also recommend doing it on a separate
> branch so you can easily revert your changes.
>

Well, there is no RVM here I'm afraid, just a server-wide Ruby
installation for all apps to use ;-(
and 'sudo gem update ramaze' doesn't seem to cut it I think.

/pagojo

John

unread,
Aug 11, 2011, 6:58:01 AM8/11/11
to Ramaze


On Aug 10, 10:46 pm, John <AthensRubyJ...@yahoo.com> wrote:
> On Aug 10, 6:35 pm, Yorick Peterse <yorickpete...@gmail.com> wrote:
>
> > John,
>
> > I've taken a quick look at the helper but I doubt this is the actual cause of
> > the problem. The reason the helper is named UserHelper and not User is
> > because the latter is a common name for models (and other general classes). I also
> > think that if this were to be an actual bug in Ramaze more people would've
> > reported it as the helper is quite popular as far as I can tell.
>
> This is what I thought, but I can't argue with what I'm seeing over
> here. The above line change fixed everything :-/
>
> I sort of have the hunch that you are right, but I'd like to find out
> really why so.
>

Indeed, you were right. I still can't figure out why this happened. I
retested it yesterday so may times and it was always the same problem
(the methods that the helper brought in eg., 'logged_in?' were not
being resolved thus leading to a method missing exception).

anyway, thanks again

/pagojo

Yorick Peterse

unread,
Aug 11, 2011, 8:14:34 AM8/11/11
to ram...@googlegroups.com
John,

So just to be sure, it's working again?

Yorick


/pagojo

John

unread,
Aug 17, 2011, 6:57:08 AM8/17/11
to Ramaze


On Aug 11, 1:14 pm, Yorick Peterse <yorickpete...@gmail.com> wrote:
> John,
>
> So just to be sure, it's working again?

Yup, but I'm keeping an eye on the lot, because it was pretty damn
weird.

Thanks again

/pagojo
Reply all
Reply to author
Forward
0 new messages