Best bet for appending querystring parameters to all links rendered under some condition?
So I'm writing a view-component that outputs some performance information, and I'm also looking at the CombineJS component that there's a patch for. I want to be able to launch an action in a MonoRail site in debug mode - which would mean the performance view- component would render as opposed to not, and the CombineJS component would not minify JS or strip comments, so that it's possible to read and step-through if necessary. So, I thought I'd add a debug=1 conditional. Fine, easy. Then I thought that, while I'm in debug mode, it would be nice if everywhere I navigated to would also be in debug mode, so I don't have to keep adding it to URLs and refreshing. What is my best bet for doing that? I guess an AfterRendering filter that parses for hrefs and so on, and then if it finds any, appends in my debug=1? I think my other possibility is maybe subclassing the UrlHelper? What do you think? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Castle Project Users group. To post to this group, send email to castle-project-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en -~--~~~~--~~--~--~---
Re: Best bet for appending querystring parameters to all links rendered under some condition?
why not use the DEBUG precompiler var? On Fri, Dec 5, 2008 at 10:36 AM, petemounce [EMAIL PROTECTED] wrote: So I'm writing a view-component that outputs some performance information, and I'm also looking at the CombineJS component that there's a patch for. I want to be able to launch an action in a MonoRail site in debug mode - which would mean the performance view- component would render as opposed to not, and the CombineJS component would not minify JS or strip comments, so that it's possible to read and step-through if necessary. So, I thought I'd add a debug=1 conditional. Fine, easy. Then I thought that, while I'm in debug mode, it would be nice if everywhere I navigated to would also be in debug mode, so I don't have to keep adding it to URLs and refreshing. What is my best bet for doing that? I guess an AfterRendering filter that parses for hrefs and so on, and then if it finds any, appends in my debug=1? I think my other possibility is maybe subclassing the UrlHelper? What do you think? -- Ken Egozi. http://www.kenegozi.com/blog http://www.delver.com http://www.musicglue.com http://www.castleproject.org http://www.gotfriends.co.il --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Castle Project Users group. To post to this group, send email to castle-project-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en -~--~~~~--~~--~--~---
Re: Want to do a fancy sum in an active Record query
AFAIK there is no CASE in HQL. But since you're querying values, not objects, I'd rather go for a SQL query in your case. -Markus 2008/12/4 M Kenyon II [EMAIL PROTECTED] I am doing a report that sums hours for several employees, based on a grouping per week. I want to find how much overtime is being spent. So, I want 2 values, a sum of all time, and a sum of just the overtime. I was thinking of doing a case statement, like in SQL, but I'm not sure how to do it in active record. I currently have a query like this: ClassificationRequest.Append(@ select trn.Week, dtl.Section.IDhttp://dtl.section.id/ , dtl.Category.IDhttp://dtl.category.id/ , sum(dtl.Hours), year(trn.Date) fromTransactionDetail dtl inner join dtl.Transaction trn inner join trn.Badge bdg inner join bdg.District dst where bdg.Classification.ID http://bdg.classification.id/ = :ID); if (region 0) { ClassificationRequest.Append(@ and dst.Region.ID http://dst.region.id/ = :RegID ); } if (district 0) { ClassificationRequest.Append(@ and dst.ID = :DistID ); } ClassificationRequest.Append(@ and trn.Date between :start AND :end group by dtl.Category.IDhttp://dtl.category.id/ , trn.Week, bdg.Classification.IDhttp://bdg.classification.id/ , dtl.Section.IDhttp://dtl.section.id/ , trn.Date ); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Castle Project Users group. To post to this group, send email to castle-project-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en -~--~~~~--~~--~--~---
Re: Best bet for appending querystring parameters to all links rendered under some condition?
Because sadly I've never known code deployed in production that hasn't needed debugging of some sort ;-) On Dec 5, 9:07 am, Ken Egozi [EMAIL PROTECTED] wrote: why not use the DEBUG precompiler var? On Fri, Dec 5, 2008 at 10:36 AM, petemounce [EMAIL PROTECTED] wrote: So I'm writing a view-component that outputs some performance information, and I'm also looking at the CombineJS component that there's a patch for. I want to be able to launch an action in a MonoRail site in debug mode - which would mean the performance view- component would render as opposed to not, and the CombineJS component would not minify JS or strip comments, so that it's possible to read and step-through if necessary. So, I thought I'd add a debug=1 conditional. Fine, easy. Then I thought that, while I'm in debug mode, it would be nice if everywhere I navigated to would also be in debug mode, so I don't have to keep adding it to URLs and refreshing. What is my best bet for doing that? I guess an AfterRendering filter that parses for hrefs and so on, and then if it finds any, appends in my debug=1? I think my other possibility is maybe subclassing the UrlHelper? What do you think? -- Ken Egozi.http://www.kenegozi.com/bloghttp://www.delver.comhttp://www.musicglue.comhttp://www.castleproject.orghttp://www.gotfriends.co.il --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Castle Project Users group. To post to this group, send email to castle-project-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en -~--~~~~--~~--~--~---
Re: Best bet for appending querystring parameters to all links rendered under some condition?
Yes; I like that approach. Thanks. On Dec 5, 9:19 am, Alex Henderson [EMAIL PROTECTED] wrote: Why not either create a debug cookie or a some debug session data after the first instance, rather then take the brute force approach of rewriting every url... then just using ?debug=0 to later remove the debug cookie/debug session variable? I would think you could keep all the logic in a single filter then... On Fri, Dec 5, 2008 at 9:36 PM, petemounce [EMAIL PROTECTED] wrote: So I'm writing a view-component that outputs some performance information, and I'm also looking at the CombineJS component that there's a patch for. I want to be able to launch an action in a MonoRail site in debug mode - which would mean the performance view- component would render as opposed to not, and the CombineJS component would not minify JS or strip comments, so that it's possible to read and step-through if necessary. So, I thought I'd add a debug=1 conditional. Fine, easy. Then I thought that, while I'm in debug mode, it would be nice if everywhere I navigated to would also be in debug mode, so I don't have to keep adding it to URLs and refreshing. What is my best bet for doing that? I guess an AfterRendering filter that parses for hrefs and so on, and then if it finds any, appends in my debug=1? I think my other possibility is maybe subclassing the UrlHelper? What do you think? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Castle Project Users group. To post to this group, send email to castle-project-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en -~--~~~~--~~--~--~---
Re: AR with Multiple DB´S
On Thu, Dec 4, 2008 at 6:06 AM, Gabriel Mancini de Campos [EMAIL PROTECTED] wrote: hi i have thinking... is not a better choice create a public class MultiBaseInterceptior : IInterceptor ??? and in moment of persistence, change the DB? someone here, know's which method from IInterceptor will be the better to implement the change??? This sounds like a pretty insane idea to me. Basically - you've done all your logic/validation using one DB and then you want to write the actual changes to another. I guess if you want all your reads to happen from one DB and all your writes to happen to another - then it's possible this isn't bad idea. Generally - you're going to get FK constraint errors, duplicate keys and all sorts of problems if you go this path (and it's not exactly what you want). j. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Castle Project Users group. To post to this group, send email to castle-project-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en -~--~~~~--~~--~--~---