move journal code to persional_journal modulaar

This commit is contained in:
Rueshyna authored and chris committed 2013-01-14 17:53:59 +08:00
1 parent 284bf34fec
commit 758cab5ecd
27 files changed
-4

No files matched your search

-20
View File
@@ -1,20 +0,0 @@
class CoAuthor
include Mongoid::Document
LANGUAGE_TYPES = [ "English", "Chinese" ]
field :name_id, type: BSON::ObjectId
field :co_author, localize: true
field :email
belongs_to :co_author_relations
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/
validates :email, format: { with: VALID_EMAIL_REGEX },
allow_blank: true,
uniqueness: { case_sensitive: false }
validates :co_author, presence: true
before_save { |coauthor| coauthor.email = email.downcase if not coauthor.email.nil?}
end
-11
View File
@@ -1,11 +0,0 @@
class CoAuthorRelation
include Mongoid::Document
include Mongoid::Timestamps
field :relation, localize: true
has_and_belongs_to_many :co_authors
validates :relation, presence: true,
uniqueness: { case_sensitive: false }
end