i have some code that uses a string to determine dynamically what model class to use and for what field to find_by() on. however, i'm having a hard time with how to use these variables to get the model instance. specifically, i have
class Item
include MongoMapper::Document
key :my_variable, String
in my code i have
m = "Item"
f = "my_variable"
and i want to be able to
i = m.find_by_my_variable( f )
result = i[f]
any help is appreciated!