[Rails-core] Date.weekend?

2013-06-27 Thread Artem Kalinchuk
Hello, Having a boolean *.weekend?* on the Date class would be a good feature. It will basically do this: saturday? || sunday? Makes the code cleaner and easier to read. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe f

[Rails-core] [Routing] Array constraints for path segments

2013-06-27 Thread Filipe Giusti
Hi, I would like to know if anyone see any disadvantages in allowing array in segments constraints in addition to regexps. For example, Photo::TYPES = %w(small big)get 'photos/:type', to: 'photos#index', constraints: { type: Photo::TYPES } my use case is that I usually have a model with a con

[Rails-core] Rails::Paths.add optional module?

2013-06-27 Thread Pier-Olivier Thibault
I use (and I know many others) uses the "/app" folder to add folder to extend rails. Some examples would be FormBuilder subclasses, Decorators, etc. My problem is that app/{my_extension} pollutes the global namespace. I would like to have app/form_builders use the FormBuilders namespace so I c

Re: [Rails-core] Re: Idea: status code 404 AND debug info for RecordNotFound, RoutingError

2013-06-27 Thread Henrik Nyh
Oh, I let the custom better_errors page fool me. The standard error page does give a 404 for RecordNotFound (in 3.2, but I'm sure Rails 4 works as well). Sorry to bring this up before experimenting more, and thanks for pointing me in the right direction. On Wed, Jun 26, 2013 at 8:09 PM, Bob Bre

Re: [Rails-core] A change that may not hurt anybody - move the js include tag to the bottom

2013-06-27 Thread Mohamed Wael Khobalatte
This is such an obvious tip that I am sure this has been discussed before. On Thu, Jun 27, 2013 at 5:33 AM, Hector Bustillos < hector.bustil...@crowdint.com> wrote: > I was working a lot on performance improvements on rails apps when I > realize that we always talking about ways to improve the p

[Rails-core] A change that may not hurt anybody - move the js include tag to the bottom

2013-06-27 Thread Hector Bustillos
I was working a lot on performance improvements on rails apps when I realize that we always talking about ways to improve the page load of our apps, basically ways to show things faster. One of those 'ways' is to simple move the js include to the bottom of our page. So, I got this questions why

Re: [Rails-core] Re: Idea: status code 404 AND debug info for RecordNotFound, RoutingError

2013-06-27 Thread Bob Breznak
This seems like a regression in 4.0.0. I believe that previous versions were returning 404's for RecordNotFound in development. -- Bob Breznak @bobbrez 617 863 0262 On Wednesday, June 26, 2013 at 8:48 AM, Henrik N wrote: > Actually, RoutingError seems to do this already. I noticed the lack i

[Rails-core] Parentheses cannot be used with Rails routing/journey

2013-06-27 Thread Rick Martinez
Hey all, It seems that there is no real way to use parentheses in Rails' routing. As far as I can tell, they can't be escaped to take away their "optional" meaning. The grammar that Journey uses treat parentheses as reserved characters, always. This is an issue as it makes protocols like OData

Re: [Rails-core] Re: false.present? is false. Is it desired behaviour?

2013-06-27 Thread Carlos Antonio da Silva
As you can see here: https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/object/blank.rb#L55, blank? is also implemented in FalseClass to always return true, so yes, it was deliberate :) On Thu, Jun 27, 2013 at 8:17 AM, Amitav Mohanty wrote: > Hey > > On Wed, Jun

Re: [Rails-core] Re: false.present? is false. Is it desired behaviour?

2013-06-27 Thread Amitav Mohanty
Hey On Wed, Jun 26, 2013 at 10:04 PM, Piotr Sarnacki wrote: > While technically you could say that "false" is "present", it would be > really unintuitive for most of the people as present? is supposed to be > just opposite of blank? and is used to check for truthiness. Additionally > present? is