Ramaze 2011.07.25 User helper bug

Showing 1-6 of 6 messages
Ramaze 2011.07.25 User helper bug John 8/10/11 10:09 AM
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?
Re: Ramaze 2011.07.25 User helper bug Yorick Peterse 8/10/11 10:35 AM
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.


Re: Ramaze 2011.07.25 User helper bug John 8/10/11 2:46 PM


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
Re: Ramaze 2011.07.25 User helper bug John 8/11/11 3:58 AM


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
Re: Ramaze 2011.07.25 User helper bug Yorick Peterse 8/11/11 5:14 AM
John,

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

Yorick


/pagojo

--
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.


Re: Ramaze 2011.07.25 User helper bug John 8/17/11 3:57 AM


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