<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -131,7 +131,7 @@ class Article
     end
 
     def get_archive_hash
-      counts = self.find_by_sql(&quot;SELECT COUNT(*) as count, #{specific_date_function} FROM articles WHERE published_at IS NOT NULL AND published = 1 GROUP BY year, month ORDER BY year DESC, month DESC&quot;)
+      counts = repository.adapter.query(&quot;SELECT COUNT(*) as count, #{specific_date_function} FROM articles WHERE published_at IS NOT NULL AND published = 1 GROUP BY year, month ORDER BY year DESC, month DESC&quot;)
       archives = counts.map do |entry|
         {
           :name =&gt; &quot;#{Date::MONTHNAMES[entry.month.to_i]} #{entry.year}&quot;,
@@ -145,8 +145,7 @@ class Article
 
     private 
       def specific_date_function
-        # This is pretty nasty loading up the db.yml to get at this, but I wasn't able to find the method in merb just yet. Change it!
-        if YAML::load(File.read(&quot;config/database.yml&quot;))[Merb.environment.to_sym][:adapter] == 'sqlite3'
+        if Merb::Orms::DataMapper.full_config[Merb.environment.to_s][&quot;adapter&quot;] == &quot;sqlite3&quot;
           &quot;strftime('%Y', published_at) as year, strftime('%m', published_at) as month&quot;
         else
           &quot;extract(year from published_at) as year, extract(month from published_at) as month&quot;</diff>
      <filename>app/models/article.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>3ecb1bc008c4d7156f2e4dc6e3fe95b8e8726c0d</id>
    </parent>
  </parents>
  <author>
    <name>AJ Christensen</name>
    <email>aj@junglist.gen.nz</email>
  </author>
  <url>http://github.com/mleung/feather/commit/4904834fe0ae86fefa5ddbec97036aec104938e9</url>
  <id>4904834fe0ae86fefa5ddbec97036aec104938e9</id>
  <committed-date>2008-07-18T12:54:13-07:00</committed-date>
  <authored-date>2008-07-08T15:25:11-07:00</authored-date>
  <message>Fixed the archive searcher to use repository.adapter.query instead of self.find_by_sql as the behaviour has changed. Also fixed the specific_date_function to no longer load up the config/database.yml</message>
  <tree>7937a38eb0efb934acbe87196d08a9331501d1c9</tree>
  <committer>
    <name>El Draper</name>
    <email>el@eldiablo.co.uk</email>
  </committer>
</commit>
