A platform for community discussion. Free, open, simple.
FIX: Polls didn't work in imported posts
Gerhard Schlagere8053d6e7df3
diff --git a/app/models/post.rb b/app/models/post.rbindex a923d1da05b..7279a0ff271 100644--- a/app/models/post.rb+++ b/app/models/post.rb@@ -55,13 +55,13 @@ class Post < ActiveRecord::Basehas_many :user_actions, foreign_key: :target_post_id- validates_with ::Validators::PostValidator+ validates_with ::Validators::PostValidator, unless: :skip_validationafter_save :index_searchafter_save :create_user_action# We can pass several creating options to a post via attributes- attr_accessor :image_sizes, :quoted_post_numbers, :no_bump, :invalidate_oneboxes, :cooking_options, :skip_unique_check+ attr_accessor :image_sizes, :quoted_post_numbers, :no_bump, :invalidate_oneboxes, :cooking_options, :skip_unique_check, :skip_validationLARGE_IMAGES ||= "large_images".freezeBROKEN_IMAGES ||= "broken_images".freezediff --git a/lib/post_creator.rb b/lib/post_creator.rbindex 62d2c39dd62..c5c09d04d1b 100644--- a/lib/post_creator.rb+++ b/lib/post_creator.rb@@ -476,7 +476,8 @@ class PostCreatordef save_post@post.disable_rate_limits! if skip_validations?- saved = @post.save(validate: !skip_validations?)+ @post.skip_validation = skip_validations?+ saved = @post.saverollback_from_errors!(@post) unless savedend