sqlite3, test coverage improvements, auto auth

This commit is contained in:
2015-10-23 19:34:59 -05:00
parent 41ceccc5b5
commit 7ddf93578e
15 changed files with 143 additions and 83 deletions

View File

@ -1,3 +1,4 @@
class Authentication < ActiveRecord::Base
belongs_to :user
belongs_to :person
validates :uid, presence: true, uniqueness: { scope: :provider }
end

View File

@ -11,7 +11,7 @@ class Person < ActiveRecord::Base
validates :phone, presence: true
scope :with_name, lambda { |name|
where("concat(first_name, ' ', last_name) RLIKE ?", name)
where("first_name || ' ' || last_name LIKE ?", "%#{name}%")
}
scope :just_parents, lambda {
@ -34,6 +34,10 @@ class Person < ActiveRecord::Base
id
end
def active?
activation_state == "active"
end
private
## SorceryCore expects the model to hold a crypted_password field