End of day commit

This commit is contained in:
2015-02-18 22:36:47 +01:00
parent 82670f271b
commit c1858455e9
68 changed files with 633 additions and 145 deletions
+13 -4
View File
@@ -2,14 +2,23 @@ class Employee
include SimplyStored::Couch
include ActiveModel::SerializerSupport
devise :database_authenticatable, :recoverable, :rememberable, :trackable #, :omniauthable, :omniauth_providers => [:facebook] #, :token_authenticatable , :registerable
view :by_confirmation_token, key: :confirmation_token # devise confirmable
devise :database_authenticatable, :recoverable, :rememberable, :trackable, :registerable, :confirmable
property :unconfirmed_email
property :name
property :email
#property :email
view :by_email, key: :email
validates :email, email: true
belongs_to :supplier
class << self
def count_by_email(email)
database.view by_email(key: email, reduce: true)
end
end
#validates :email, email: true
has_and_belongs_to_many :suppliers, storing_keys: false
has_many :orders
has_and_belongs_to_many :lists, storing_keys: false