François Beausoleil
2007-Dec-13 15:49 UTC
Merb::RenderMixin#set_status refers to non-existent RESPONSE_CODES constant
#set_status http://merb.devjavu.com/browser/trunk/lib/merb/mixins/render.rb#L270 refers to a non-existent constant. I tried, while creating #359, to make things OK, but I failed. I started by using STATUS_CODES instead, then used #[] instead of calling a method named STATUS_CODES, then I found out that during the call to #inherited http://merb.devjavu.com/browser/trunk/lib/merb/exceptions.rb#L111, the STATUS constant isn''t defined (yet). I tried to add a #status method to Base, but even that failed because the class didn''t have the constant during the call to #inherited. So, I''m rather stuck. It''s probably a good idea to make the exception subclasses have a method, rather than a constant, to return the correct status code value. What''s the consensus ? Should I start work on this ? What effect would this have on the rest of the code ? Bye ! Fran?ois Beausoleil http://blog.teksol.info/
Ezra Zygmuntowicz
2007-Dec-13 21:57 UTC
Merb::RenderMixin#set_status refers to non-existent RESPONSE_CODES constant
On Dec 13, 2007, at 7:49 AM, Fran?ois Beausoleil wrote:> #set_status > http://merb.devjavu.com/browser/trunk/lib/merb/mixins/render.rb#L270 > > refers to a non-existent constant. I tried, while creating #359, to > make things OK, but I failed. I started by using STATUS_CODES > instead, > then used #[] instead of calling a method named STATUS_CODES, then I > found out that during the call to #inherited > http://merb.devjavu.com/browser/trunk/lib/merb/exceptions.rb#L111, the > STATUS constant isn''t defined (yet). I tried to add a #status > method to > Base, but even that failed because the class didn''t have the constant > during the call to #inherited. > > So, I''m rather stuck. It''s probably a good idea to make the exception > subclasses have a method, rather than a constant, to return the > correct > status code value. > > What''s the consensus ? Should I start work on this ? What effect > would > this have on the rest of the code ? > > Bye ! > Fran?ois Beausoleil > http://blog.teksol.info/ >Francios- I have applied your doc patch and I also think I fixed the code problem with the set_status helper. Can you please try again with trunk and verify it works for you? Thanks - Ezra Zygmuntowicz -- Founder & Software Architect -- ezra at engineyard.com -- EngineYard.com