<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>spec/models/album_art_image_spec.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -4,6 +4,7 @@ class AlbumArt &lt; ActiveRecord::Base
   has_one :album_art_image
  # before_save :set_image_filesize, :set_image_size
 
+  validates_associated :album_art_image
   validates_presence_of :user_id, :album_name, :artist_name, :message =&gt; &quot;deve ser preenchido&quot;
   
 #  file_column :image, :magick =&gt; {</diff>
      <filename>app/models/album_art.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,12 +2,12 @@ class AlbumArtImage &lt; ActiveRecord::Base
 
   belongs_to :album_art
   
-  has_attachment :max_size =&gt; 10.kilobytes, 
+  has_attachment :max_size =&gt; 100.kilobytes, 
                  :resize_to =&gt; [300,300], 
                  :content_type =&gt; :image,
                  :storage =&gt; :file_system,
                  :processor =&gt; 'MiniMagick',
                  :thumbnails =&gt; {:thumb =&gt; [150,150] }
 
-
+  validates_as_attachment
 end</diff>
      <filename>app/models/album_art_image.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,7 +9,18 @@
 #
 # It's strongly recommended to check this file into your version control system.
 
-ActiveRecord::Schema.define(:version =&gt; 4) do
+ActiveRecord::Schema.define(:version =&gt; 7) do
+
+  create_table &quot;album_art_images&quot;, :force =&gt; true do |t|
+    t.integer &quot;size&quot;
+    t.string  &quot;content_type&quot;
+    t.string  &quot;filename&quot;
+    t.integer &quot;height&quot;
+    t.integer &quot;width&quot;
+    t.integer &quot;parent_id&quot;
+    t.string  &quot;thumbnail&quot;
+    t.integer &quot;album_art_id&quot;
+  end
 
   create_table &quot;album_arts&quot;, :force =&gt; true do |t|
     t.integer  &quot;user_id&quot;</diff>
      <filename>db/schema.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,7 +8,6 @@ module AlbumArtSpecHelper
       :album_name =&gt; &quot;Anacr&#244;nico&quot;,
       :artist_name =&gt; &quot;Pitty&quot;,
       :score =&gt; 0,
-      :image =&gt; fixture_file_upload(&quot;/files/anacronico.jpg&quot;, &quot;image/jpeg&quot;),
       :image_filesize =&gt; '29600',
       :image_size =&gt; '300x300'
     }
@@ -41,10 +40,6 @@ describe AlbumArt do
     @album_art.should have(1).error_on(:artist_name)
   end
   
-  it &quot;should have 1 error on image&quot; do
-    @album_art.should have(1).error_on(:image)
-  end
-  
   it &quot;should have a initial score of zero&quot; do
     @album_art.attributes = valid_album_art_attributes
     @album_art.score.should equal(0)</diff>
      <filename>spec/models/album_art_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>84d28a876765578b0ba33df669feebfee64ee1ae</id>
    </parent>
  </parents>
  <author>
    <name>shadowma</name>
    <email>shadowma@d798d9e0-5e21-0410-a9a4-a952c4db9e3f</email>
  </author>
  <url>http://github.com/shadow11/cd-covers/commit/53c5f4612b1f59a17d6be8ea2e3280bb9044b52c</url>
  <id>53c5f4612b1f59a17d6be8ea2e3280bb9044b52c</id>
  <committed-date>2008-02-21T17:53:31-08:00</committed-date>
  <authored-date>2008-02-21T17:53:31-08:00</authored-date>
  <message>Tried to solve testing issues after switching from file_column to attachment_fu. Added validation to the AlbumArtImage model


git-svn-id: svn+ssh://shadowmaru.org/home/shadowma/my_svn/cdcovers@108 d798d9e0-5e21-0410-a9a4-a952c4db9e3f</message>
  <tree>1f56ed9c88620ce9d64e5f3dcacd37c708c54b0b</tree>
  <committer>
    <name>shadowma</name>
    <email>shadowma@d798d9e0-5e21-0410-a9a4-a952c4db9e3f</email>
  </committer>
</commit>
