diff options
| author | mo khan <mo@mokhan.ca> | 2014-02-21 07:04:37 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-02-21 07:04:37 -0700 |
| commit | 5d937942170c81bcb2304cab1c71eefda48e4e35 (patch) | |
| tree | f46cb5f947c15ec42e2c616ccd2e74adc26e773f /app/models/expired_status.rb | |
| parent | bd1b2145347c25ee6fba54e306d5e11749e511d0 (diff) | |
move status filtering behaviour to separate status classes.
Diffstat (limited to 'app/models/expired_status.rb')
| -rw-r--r-- | app/models/expired_status.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/expired_status.rb b/app/models/expired_status.rb new file mode 100644 index 0000000..11ee7f7 --- /dev/null +++ b/app/models/expired_status.rb @@ -0,0 +1,10 @@ +class ExpiredStatus + def initialize(name) + @name = name + end + + def filter(licenses) + today = DateTime.now + licenses.where('expired_at < ?', today) + end +end |
