I've been experimenting with rails since before 1.0. I actually
deployed an application with 2.0.x something. It is my test
application that has been written in Excel, Applescript, PHP, Active4D
and Rails. It is just a little local golf group scoring application -
AKA sort of a handicap system.
With each language I've enhanced the system but I choose to start from
scratch with Rails3. (I could not get the rails upgrade plugin to work
- but I needed to de-PHP the application anyhow). I overwrote the
generations and the CRUD part of the application are pure rails3.
and part framework code. I was trying to clean up that part and have
made some observations.
group has many members # Enhanced to handle different groups
member has many rounds # where the scores are stored
There are other things like course, tees, events etc that come into
play in this post
When scores are entered (for each member at the event), it goes
through a multi form process. The first part determines who played in
this event. The second part verifies the input and saves the data.
In the verify view I query the rounds played for the member on the
course and each course tee and compute a "quota" or handicap for that
course/tee. In rails 2.x I had something like:
cond = 'member_id = ' + member.id.to_s + ' and tee_id = ' +
therounds = Round.find(:all,:conditions => cond, :order => "date
DESC", :limit => group.quota_limit+1)
The MVP police question is "Is this okay? I not, what rule does this
break? and how would you do it?"
Playing with rails3 finders, I came up with something like
therounds = member.rounds.where(:tee_id => tee).order("date
DESC").limit((group.quota_limit + 1))
Rails3 takes almost twice as long ( 700ms vs 1300ms). Is this going to
I really like the rails3 approach, but is it going to be twice as