<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,4 +1,4 @@
 *.db
 log/
-uploads/*
+public/uploads/*
 pkg/</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -2,8 +2,11 @@ class MediaRocket::Media
   include DataMapper::Resource
   
   property :id, Serial
-  property :path, String, :nullable =&gt; false
-  # property :md5sum, String, :length =&gt; 32, :default =&gt; Proc.new { |r, p| Digest::MD5.hexdigest(r.path.read) if r.path }
+  property :path, FilePath, :nullable =&gt; false
+  property :md5sum, String, :length =&gt; 32, :default =&gt; Proc.new { |r, p| Digest::MD5.hexdigest(r.path.read) if r.path }
+  property :title, String
+  property :description, String
+  property :position, Integer
   property :created_at, DateTime
   property :deleted_at, ParanoidDateTime
   property :deleted,    ParanoidBoolean
@@ -73,8 +76,9 @@ class MediaRocket::Media
       # FIX: rework using unique sha1 hash for basename
       unique = 0
       path = File.join(path, File.basename(options[:file][:filename]))
+      extension = File.extname(options[:file][:filename])
       while File.exist?(path)
-        path = File.join(File.dirname(path), File.basename(options[:file][:filename]) + unique.to_s)
+        path = File.join(File.dirname(path), File.basename(options[:file][:filename], extension) + unique.to_s + extension)
         unique += 1
       end
       
@@ -83,8 +87,7 @@ class MediaRocket::Media
       FileUtils.mkdir_p File.dirname(path) unless File.exist?(File.dirname(path))
       FileUtils.mv options[:file][:tempfile].path, path
       
-      #@path = Pathname.new(path)
-      @path = path
+      self.path = Pathname.new path
     else
       return nil
     end</diff>
      <filename>app/models/media.rb</filename>
    </modified>
    <modified>
      <diff>@@ -14,7 +14,7 @@
 
 	&lt;div id=&quot;last_media&quot; class=&quot;box prepend-top&quot;&gt;
 		&lt;h2 class=&quot;caps&quot;&gt;Last media&lt;/h2&gt;
-		&lt;%= media_list_last %&gt;
+		&lt;%= media_list_last :width =&gt; &quot;150px&quot; %&gt;
 	&lt;/div&gt;
 
 &lt;/div&gt;
\ No newline at end of file</diff>
      <filename>app/views/main/index.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -78,12 +78,12 @@ if defined?(Merb::Plugins)
   use_orm :datamapper
   
   
-  merb_version = &quot;&gt;= 1.0&quot;
+  merb_version = &quot;&gt;= 1.0.7.1&quot;
   dependency 'merb-assets',     merb_version
   dependency 'merb-helpers',    merb_version
   dependency 'merb_datamapper', merb_version
   
-  dm_gems_version   = &quot;&gt;= 0.9.8&quot;
+  dm_gems_version   = &quot;&gt;= 0.9.9&quot;
   dependency &quot;dm-core&quot;, dm_gems_version         
   dependency &quot;dm-aggregates&quot;, dm_gems_version   
   dependency &quot;dm-migrations&quot;, dm_gems_version   </diff>
      <filename>lib/media_rocket.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,10 +5,8 @@ module MediaRocket
       def media_list_last(options = {}, &amp;block)
         medias = &quot;&quot;
         limit = options[:limit] || 10
-        medias = MediaRocket::Media.all(:order =&gt; [:created_at.desc])
-        
-        medias[0...limit].each do |media|
-          medias &lt;&lt; tag(:a, self_closing_tag(:img, :src =&gt; media.url), :href =&gt; media.url)
+        MediaRocket::Media.all(:order =&gt; [:created_at.desc])[0...limit].each do |media|
+          medias &lt;&lt; tag(:a, self_closing_tag(:img, :src =&gt; media.url, :width =&gt; options[:width]), :href =&gt; media.url)
         end
         medias
       end
@@ -46,6 +44,10 @@ module MediaRocket
         output
       end
       
+      def media_categories(options = {}, &amp;block)
+        
+      end
+      
     end
   end
 end
\ No newline at end of file</diff>
      <filename>lib/media_rocket/helpers/content.rb</filename>
    </modified>
    <modified>
      <diff>@@ -24,6 +24,11 @@ describe MediaRocket::Media do
     @media.url.should == &quot;/uploads/image.png&quot;
   end
   
+  it &quot;should save a new Media with image&quot; do
+    @media = MediaRocket::Media.new :file =&gt; test_file
+    @media.save.should == true
+  end
+  
   it &quot;should create a unique Media if conflict on name&quot; do
     @media = MediaRocket::Media.new :file =&gt; test_file
     </diff>
      <filename>spec/models/media_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>1e02b9c1269c74d8fce111c1fe70982ad858c1a5</id>
    </parent>
  </parents>
  <author>
    <name>Alexandre Girard</name>
    <email>alx.girard@gmail.com</email>
  </author>
  <url>http://github.com/alx/media_rocket/commit/e2760984324fe5fefe465977c01cbb7693d4d447</url>
  <id>e2760984324fe5fefe465977c01cbb7693d4d447</id>
  <committed-date>2009-01-10T11:35:33-08:00</committed-date>
  <authored-date>2009-01-10T11:35:33-08:00</authored-date>
  <message>Correct problem with media path. Change dependencies version numbers. Add option to media_last_list</message>
  <tree>4363ea82cb777c9afbd937c31539ab497ea345f8</tree>
  <committer>
    <name>Alexandre Girard</name>
    <email>alx.girard@gmail.com</email>
  </committer>
</commit>
