forked from saurabh/personal-journal
16 lines
443 B
Ruby
16 lines
443 B
Ruby
class JournalPaperAuthor
|
|
include Mongoid::Document
|
|
include Mongoid::Timestamps
|
|
|
|
field :name, type: String, localize: true
|
|
field :email, type: String
|
|
field :should_destroy, type: Boolean
|
|
|
|
has_and_belongs_to_many :journal_papers
|
|
has_and_belongs_to_many :journal_paper_author_types
|
|
|
|
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/
|
|
validates :email, format: { with: VALID_EMAIL_REGEX },
|
|
allow_blank: true
|
|
end
|