fixes #1306
This commit is contained in:
@@ -14,6 +14,7 @@ class Post < ActiveRecord::Base
|
|||||||
before_save :create_tags
|
before_save :create_tags
|
||||||
before_save :update_tag_post_counts
|
before_save :update_tag_post_counts
|
||||||
before_save :set_tag_counts
|
before_save :set_tag_counts
|
||||||
|
before_save :strip_source
|
||||||
before_validation :initialize_uploader, :on => :create
|
before_validation :initialize_uploader, :on => :create
|
||||||
before_validation :parse_pixiv_id
|
before_validation :parse_pixiv_id
|
||||||
before_validation :blank_out_nonexistent_parents
|
before_validation :blank_out_nonexistent_parents
|
||||||
@@ -1136,6 +1137,10 @@ class Post < ActiveRecord::Base
|
|||||||
@typed_tags = nil
|
@typed_tags = nil
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def strip_source
|
||||||
|
self.source = source.strip
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
Post.connection.extend(PostgresExtensions)
|
Post.connection.extend(PostgresExtensions)
|
||||||
|
|||||||
Reference in New Issue
Block a user