Logo

on Radio !!!

about 4 years ago | Rohan Kini: Confuscionomo

I cant believe I almost passed the chance of being on radio !

Got a call from Radio City asking if I could be on air the next morning (day before). They were having a show on Bangaloreans doing things a little differently. And I got called for biking to work and because of BumsOnTheSaddle

Didnt think too much about this, was only worried about screwing up as this was going to be a live show ! What if you say something wrong, what if you are unable to say anything - in front of tons of Bangaloreans !!! Sheesh. What a way to start a day.


RJ Vasanthi at the Radio city studio - in action

But then I must admit it was one helluva experience. It was the Breakfast show, with the award winning RJ Vasanthi who was extremely nice and made me comfortable in no time at all :) The next time you are listening to the Radio City Breakfast show this is what Vasathi is doing - playing music, checking sms's which are pouring onto here system, taking calls from listeners, figuring out what to talk next to the guest on the show, drinking coffee, taking personal calls and chatting away with the guest and at the same time doing short segments on the show like traffic update etc etc. All at the same time. Kinda incredible !

Moral of the story - never say no to things like this. Go. Experience !

Just when I was starting to get comfortable and was all loosened up to talk it was all over ! Sigh.
Did manage to talk a little bit about the bicycling scene in Bangalore and what it takes to bicycle to work. Wish I had a more planned agenda. Figured Radio is a really powerful medium that can reach so many people at once ! Next time :)



came out to a familiar Bangalore scene. Traffic Jams. Sigh !
Balloon pricked.

TVs Still rule compared to the radio. A quick look at Google Analytics stats after this short interview on radio showed



Till date nothing has generated traffic like the interview on CNN IBN did. Interesting huh.

rohan_kini @ 2008-01-12T17:21:00

about 4 years ago | Rohan Kini: Confuscionomo



Spirit of the Marathon - trailer.

the solution

about 4 years ago | Rohan Kini: Confuscionomo

Plugin to Support composed_of Aggregations in ActiveRecord Finder Methods

about 4 years ago | Ryan Kinderman: kinderman.net :

In Rails, hooking up an ActiveRecord model to use a value object to aggregate over a set of database fields is a piece of cake. With the accessor methods that are created for a composed_of association, you can now deal exclusively with the composed_of field on your model, instead of directly manipulating or querying the individual database fields that it aggregates. Or can you? As long as all you're doing with the aggregate field is getting and setting its value, your aggregated database fields remain encapsulated. However, if you want to retrieve instances of your model from the database through a call to a finder method, you must do so on the individual database fields.

Consider the following ActiveRecord model definition:

class Customer < ActiveRecord::Base
  composed_of :balance, :class_name => "Money", :mapping => %w(balance_amount amount)
end

Given such a model, we can do something like this with no problem:

customer = Customer.new
customer.balance = Money.new(512.08)
customer.balance                      # returns #<Money:abc @amount=512.08>
customer.save!

However, now that we've saved the record, we might want to get that record back from the database at some point with code that looks something like:

customer = Customer.find(:all, :conditions => { :balance => Money.new(512.08) })

or like:

customer = Customer.find_all_by_balance( Money.new(512) )

This would provide full encapsulation of the aggregated database fields for the purposes of both record creation and retrieval. The problem is, at the time of my posting this article, it doesn't work. Instead, you have to do this:

customer = Customer.find(:all, :conditions => { :balance_amount => 512.08 })

To deal with this problem, I've submitted a ticket, which is currently scheduled to be available in Rails 2.1.

If you need this functionality, but your project is using a pre-2.1 release of Rails, I've also created a plugin version of the changes I submitted in the aforementioned ticket. To install:

script/plugin install git://github.com/ryankinderman/find_conditions_with_aggregation.git

Addendum: The patch has been committed to changeset 8671. Yay!