fixes conflicts with master [#25]
This commit is contained in:
@@ -12,6 +12,9 @@ class Debate < ActiveRecord::Base
|
||||
|
||||
validates :terms_of_service, acceptance: { allow_nil: false }, on: :create
|
||||
|
||||
before_validation :sanitize_description
|
||||
before_validation :sanitize_tag_list
|
||||
|
||||
def likes
|
||||
get_likes.size
|
||||
end
|
||||
@@ -32,4 +35,18 @@ class Debate < ActiveRecord::Base
|
||||
editable? && author == user
|
||||
end
|
||||
|
||||
end
|
||||
def description
|
||||
super.try :html_safe
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def sanitize_description
|
||||
self.description = WYSIWYGSanitizer.new.sanitize(description)
|
||||
end
|
||||
|
||||
def sanitize_tag_list
|
||||
self.tag_list = TagSanitizer.new.sanitize_tag_list(self.tag_list)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class User < ActiveRecord::Base
|
||||
devise :database_authenticatable, :registerable,
|
||||
devise :database_authenticatable, :registerable, :confirmable,
|
||||
:recoverable, :rememberable, :trackable, :validatable
|
||||
|
||||
def name
|
||||
|
||||
Reference in New Issue
Block a user