Eric Davis
2950051383
Checking date input for Rate#for. #1920
2009-01-16 16:59:49 -08:00
Eric Davis
7bca02b511
Instead of returning nil, which could get confused with No Rate, passing
...
incorrect objects to Rate#for will now throw a Rate::InvalidParameterException
back to the caller.
Normally you don't need to be this strict but this is a public API that will
be consumed by several third parties so we need to be very clear what happened.
#1920
2009-01-16 16:53:00 -08:00
Eric Davis
94e8aad493
Rate#for should handle invalid projects. #1920
2009-01-16 16:43:26 -08:00
Eric Davis
08b267741b
Rate#for should handle invalid users. #1920
2009-01-16 16:40:50 -08:00
Eric Davis
bab1fa7763
Singular rate
2009-01-16 16:35:05 -08:00
Eric Davis
da891cc607
Refactored Rate#for_user_project_and_date to allow nil projects. #1920
2009-01-16 16:34:38 -08:00
Eric Davis
4599e21dfb
More spec refactoring, duplicated mocks. #1920
2009-01-16 16:26:08 -08:00
Eric Davis
8b2022fa98
Removed a bunch of custom finders from the specs due to the private method refactoring and stubs. #1920
2009-01-16 16:24:38 -08:00
Eric Davis
82cf412560
Removed duplication
2009-01-16 16:22:45 -08:00
Eric Davis
24c445cce9
Extracted specs from Rate#for for Rate#for_user_project_and_date #1920
2009-01-16 16:21:45 -08:00
Eric Davis
68b7df3237
Added specs to test for using the default (today) date. #1920
2009-01-16 16:13:57 -08:00
Eric Davis
69d922a029
Refactored Rate#for to only get one record. #1920
2009-01-16 16:08:13 -08:00
Eric Davis
6a211c3e5e
Rate#for will now return the most current rate for the user matching the parameters. #1920
2009-01-16 16:06:12 -08:00
Eric Davis
b59c87b1f6
Implementing Rate#for's internal logic. #1920
2009-01-16 16:03:15 -08:00
Eric Davis
0d9c7e50de
Added specs for the Rate#for parameter. #1920
2009-01-16 15:54:14 -08:00
Eric Davis
4ea018b304
Reworded spec descriptions.
2009-01-16 15:34:40 -08:00
Eric Davis
0e8bd2153c
Prevent Rates from being destroyed if they are locked. #1919
2009-01-16 15:33:42 -08:00
Eric Davis
3ffb31fafc
Require that a Rate be unlocked before saving it. #1919
2009-01-16 15:28:34 -08:00
Eric Davis
9b0332bf78
Added a Rate#locked? check. #1919
2009-01-16 15:23:30 -08:00
Eric Davis
48d394704a
Added data validation for Rates. #1917
2009-01-16 14:14:21 -08:00
Eric Davis
3f39bdaa6b
Added associations to Rate. #1917
2009-01-16 14:00:11 -08:00
Eric Davis
a3c12fed19
Added basic rate model and it's database schema
2009-01-16 13:56:04 -08:00