diff options
Diffstat (limited to 'app/models/identity.rb')
-rw-r--r-- | app/models/identity.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/identity.rb b/app/models/identity.rb index e09d7f2..eb67b1b 100644 --- a/app/models/identity.rb +++ b/app/models/identity.rb @@ -46,6 +46,10 @@ class Identity < CouchRest::Model::Base end + def self.address_starts_with(query) + self.by_address.startkey(query).endkey(query + "\ufff0") + end + def self.for(user, attributes = {}) find_for(user, attributes) || build_for(user, attributes) end |