1. validates_presence_of that actually works for bools (false and true
allowed for input, nil not allowed)
Amen.
Another wish would be the function
ar_instance.save_guaranteeing_these_arent_blank(:name, :phone)
(or does it exist)
quick hack:
class ActiveRecord::Base
def save_unless_missing *args
self.errors.clear
passed = true
for arg in args
val = self[arg]
unless val and val != ''
self.errors.add arg, " cannot be blank"
passed = false
end
end
# could add a call to validate in here
return nil unless passed
return save
end
end
Except that it actually worked with the validates_x_of or what not.
Cheers.
-Roger
You might find some of the custom validators I wrote tobe useful. They've also been modified to allow many of the appropriate UTF-8 characters. (download link is at the bottom of the article)
1) A really simple, fast deployment option, although I am doing alright
with capistrano + nginx + mongrel cluster, I just think a very simple
system would be awesome. Although Heroku and Switchpipe are both shaping
up as options on that front.
2) Better documentation. I am disappointed that as a community we really
do a poor job of online documentation. My favorite that I have found by
far is:
I love it and it is quite good as far as interface and searching is
concerned. I just wish as a community we did a better job of having
every method properly documented with a quick summary, all possible
input values, the output, side-effects and samples. I admit books such
as "Rails Way" and "AWDR" do a good job though of filling this gap.
3) Speed and Concurrent Requests. I am very interested in Thin as far as
basic speed boosts go but there is a lot of cruft in rails that slows it
down. Just simple garbage collection fixes recently revealed can speed
up rails significantly. As a community, we need to do a better job of
reviewing and refactoring old code and speeding it up. Specifically in
terms of the routing system, the garbage collection, active record
queries, etc. I also wanted to mention the hope of having a
multi-threaded ActiveRecord one day which would allow concurrent
requests similar to the work being done with Merb.
I would like to mention that Merb is a very interesting budding
alternative. Merb + Datamapper could shape up as a viable rails
alternative within the next couple years.
Just better API docs. Rdoc doesn't do it. In fact, it blurs the
line between internal Rails code and things you are supposed to use.
There are 4 places in Rails I like to put api calls: Model, View,
Controller and Console. Given an arbitrary helper, say, I'd like to
know whether I have access to call it in those 4 places. From the
documentation.
3) Speed and Concurrent Requests. I am very interested in Thin as far as
basic speed boosts go but there is a lot of cruft in rails that slows it
down. Just simple garbage collection fixes recently revealed can speed
up rails significantly.
which are you referring to?
Yeah my wish would be rails that could just 'meld' with 1.9 to be super
fast. And fast startup time so that if you use cgi you're ok (then the
deployment problem is...less). Ideally for deployment I guess would be
mod_rails that loads 'rails' itself then for each request it forks, goes
and reads the app's configs, and processes the file (and this is fast).
Ahhh. wishing is always so easy
Thoughts?
-R