| Path: | generators/multi_bit_shift/templates/models/mbs_validation_settings.rb |
| Last Update: | Thu Sep 18 16:35:17 -0400 2008 |
This class is generated by the multi bit shift generator, and is used to specify the validation parameters for individual files. To use the class, the constants should be modified so that a index exists for each validation set.
In the default demo configuration, the hash index files is used to represent one particular column.
This class should be used in conjunction with the automatic_mbs_validation method that we include in active record, and as the validation_object passed in the options has to the multi_bit_shift_field helper. Example:
# Should be included in the main class, and in the file class
automatic_mbs_validation ValidateMbsFile.new("files")
# The helper would be used in a form, and passes the validation params to the flash applet.
multi_bit_shift_field 'object_name', 'method', {"validation_object" => ValidateMbsFile.new("files")}