Mailer and other upgrades

This commit is contained in:
2013-01-17 09:15:42 +01:00
parent 26810defcd
commit 730768cb59
36 changed files with 242 additions and 8 deletions
+7 -1
View File
@@ -1,7 +1,8 @@
class Supplier
include SimplyStored::Couch
include Devise::Orm::SimplyStored
devise :database_authenticatable, :recoverable, :rememberable, :trackable, :registerable
devise :database_authenticatable, :recoverable, :rememberable, :trackable, :registerable, :confirmable
property :unconfirmed_email
property :name
property :open, type: :boolean, default: false
@@ -30,6 +31,7 @@ class Supplier
has_many :sections, dependent: :destroy
after_create :add_section_on_create
after_create :send_creation_notifications
view :by_email, key: :email
@@ -92,4 +94,8 @@ class Supplier
@section = Section.create supplier: self, title: I18n.t('supplier.section.first_section_title')
end
def send_creation_notifications
SupplierMailer.creation(self).deliver
end
end