Hi folks. I have a very small problem which is probably very simple. But
I’ve scoured the api and the rails book with no luck.
I’m trying to get information about the database definition out of
record. When I go into console and say
I get a MysqlAdapter object, with an instance variable called @config
a hash containing all the information I need. However I can’t get at the
config variable. I can think of two solutions, neither of which is
satisfactory. Either extend the definition of MysqlAdapter to include an
accessor for database name, but I’m loathe to do this as it’s hacky and
cause problems with switching to different database types and updates to
rails. The other is to parse the config file myself, but again this is
clearly not clever as it’s duplication.
Thanks in advance