Revision 2, 0.6 kB
(checked in by falcon, 17 years ago)
|
added plugins
|
Line | |
---|
1 | class Entry < ActiveRecord::Base |
---|
2 | attr_accessor :validation_should_fail |
---|
3 | |
---|
4 | def validate |
---|
5 | errors.add("image","some stupid error") if @validation_should_fail |
---|
6 | end |
---|
7 | |
---|
8 | def after_assign |
---|
9 | @after_assign_called = true |
---|
10 | end |
---|
11 | |
---|
12 | def after_assign_called? |
---|
13 | @after_assign_called |
---|
14 | end |
---|
15 | |
---|
16 | def after_save |
---|
17 | @after_save_called = true |
---|
18 | end |
---|
19 | |
---|
20 | def after_save_called? |
---|
21 | @after_save_called |
---|
22 | end |
---|
23 | |
---|
24 | def my_store_dir |
---|
25 | # not really dynamic but at least it could be... |
---|
26 | "my_store_dir" |
---|
27 | end |
---|
28 | |
---|
29 | def load_image_with_rmagick(path) |
---|
30 | Magick::Image::read(path).first |
---|
31 | end |
---|
32 | end |
---|