]> git.openstreetmap.org Git - rails.git/blobdiff - vendor/plugins/file_column/test/fixtures/entry.rb
Updating to use Rails 2.1.2. Moving the gem dependancies to the config/environment...
[rails.git] / vendor / plugins / file_column / test / fixtures / entry.rb
diff --git a/vendor/plugins/file_column/test/fixtures/entry.rb b/vendor/plugins/file_column/test/fixtures/entry.rb
new file mode 100644 (file)
index 0000000..b9f7c95
--- /dev/null
@@ -0,0 +1,32 @@
+class Entry < ActiveRecord::Base
+  attr_accessor :validation_should_fail
+
+  def validate
+    errors.add("image","some stupid error") if @validation_should_fail
+  end
+  
+  def after_assign
+    @after_assign_called = true
+  end
+  
+  def after_assign_called?
+    @after_assign_called
+  end
+  
+  def after_save
+    @after_save_called = true
+  end
+
+  def after_save_called?
+    @after_save_called
+  end
+
+  def my_store_dir
+    # not really dynamic but at least it could be...
+    "my_store_dir"
+  end
+
+  def load_image_with_rmagick(path)
+    Magick::Image::read(path).first
+  end
+end