From a database administrator??™s (DBA) point of view, it also means there is less need for
database checks and procedures to ensure data integrity. From a user??™s point of view, it
usually means a more intuitive experience where typos and common errors are automatically
caught and dealt with.
CHAPTER 4 ?– CORE FEATURES OF ACTIVE RECORD 80
??? Many times, business logic is applied to specific data values or types; validations make
for more accurate results and expected execution in these situations.
??? Validations make your database more secure; potentially harmful data or scripts can be
prevented from getting into your database.
??? Validations help save on bandwidth and processing; rejecting data and throwing an error
as early as possible within the life cycle of your Active Record object saves on resources.
There is no need to involve the expensive call to the database until the data is really
ready to be stored.
As you can see, there can be lots of reasons to do data validations, and hopefully, by now,
you??™ve decided that data validations really are useful.
Pages:
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211