diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-08-09 18:39:44 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-08-09 18:39:44 +0100 |
commit | 2e50110eac439f3d5d292f1519ae7c79991eb91a (patch) | |
tree | 5ba10ebd6ddf0a7487754798993d3862ee9ec3b3 /activemodel/test/models/custom_reader.rb | |
parent | a7f09bc12236d9e7bdc2ee34d5fe3c782d6ad385 (diff) | |
parent | bb1e1776914edf3be7e46b55036c18a64595f919 (diff) | |
download | rails-2e50110eac439f3d5d292f1519ae7c79991eb91a.tar.gz rails-2e50110eac439f3d5d292f1519ae7c79991eb91a.tar.bz2 rails-2e50110eac439f3d5d292f1519ae7c79991eb91a.zip |
Merge commit 'mainstream/master'
Diffstat (limited to 'activemodel/test/models/custom_reader.rb')
-rw-r--r-- | activemodel/test/models/custom_reader.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/activemodel/test/models/custom_reader.rb b/activemodel/test/models/custom_reader.rb new file mode 100644 index 0000000000..7ac70e6167 --- /dev/null +++ b/activemodel/test/models/custom_reader.rb @@ -0,0 +1,17 @@ +class CustomReader + include ActiveModel::Validations + + def initialize(data = {}) + @data = data + end + + def []=(key, value) + @data[key] = value + end + + private + + def read_attribute_for_validation(key) + @data[key] + end +end
\ No newline at end of file |