diff options
| author | mo khan <mo@mokhan.ca> | 2014-02-21 23:29:26 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-02-21 23:29:26 -0700 |
| commit | d0aaa1ee5724c4981aba10efeb7e9abde27da13d (patch) | |
| tree | c4766518aabd80b87f4a69141e80f8cf368a83e2 /app/models/license.rb | |
| parent | dcb8cddfc3adeb3be6885c00933f1354d3d1e576 (diff) | |
add integration test and add township query method.
Diffstat (limited to 'app/models/license.rb')
| -rw-r--r-- | app/models/license.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/license.rb b/app/models/license.rb index 6170683..77aad5f 100644 --- a/app/models/license.rb +++ b/app/models/license.rb @@ -9,4 +9,12 @@ class License < ActiveRecord::Base offset = offset >= 0 ? offset : 0 License.order(created_at: :desc).offset(offset).limit(per_page) end + + def self.township(township) + joins(:location).where('locations.township = ?', township) + end + + def self.status(status) + status.filter(self) + end end |
