summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorankonym <ankonym@gmail.com>2015-08-13 17:24:02 +0200
committerankonym <ankonym@gmail.com>2015-09-28 15:12:44 +0200
commit8b9b2a0c3c8457024d99d0794416c59cb245a513 (patch)
tree6156aee857998f877954c25f1b891fac227c6f1f /app
parentbd98a2cbb8796039efbffb7039a9bda1cde22dae (diff)
Changed invite code query to look for invite_code string instead of id
Diffstat (limited to 'app')
-rw-r--r--app/models/invite_code.rb2
-rw-r--r--app/models/invite_code_validator.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/invite_code.rb b/app/models/invite_code.rb
index b9f6f33..751b28e 100644
--- a/app/models/invite_code.rb
+++ b/app/models/invite_code.rb
@@ -4,7 +4,7 @@ class InviteCode < CouchRest::Model::Base
timestamps!
design do
- view :by__id
+ view :by_invite_code
end
end
diff --git a/app/models/invite_code_validator.rb b/app/models/invite_code_validator.rb
index 55b7a74..978d3f5 100644
--- a/app/models/invite_code_validator.rb
+++ b/app/models/invite_code_validator.rb
@@ -7,7 +7,7 @@ class InviteCodeValidator < ActiveModel::Validator
private
def not_existent?(code)
- InviteCode.find_by__id(code) == nil
+ InviteCode.find_by_invite_code(code) == nil
end
def add_error_to_user(error, user)