fixed edge case for pool creation
This commit is contained in:
@@ -440,7 +440,7 @@ class Post < ActiveRecord::Base
|
||||
if pool.nil?
|
||||
pool = Pool.create(:name => $1, :description => "This pool was automatically generated")
|
||||
end
|
||||
add_pool!(pool)
|
||||
add_pool!(pool) if pool
|
||||
|
||||
when /^rating:([qse])/i
|
||||
self.rating = $1.downcase
|
||||
|
||||
@@ -28,7 +28,7 @@ class TagImplication < ActiveRecord::Base
|
||||
all.concat(children)
|
||||
children = self.class.where(["antecedent_name IN (?)", children]).all.map(&:consequent_name)
|
||||
end
|
||||
end.sort
|
||||
end.sort.uniq
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ PoolVersion.find_each do |version|
|
||||
version.update_column(:post_ids, version.post_ids.scan(/\d+/).in_groups_of(2).map {|x| x.first}.join(" "))
|
||||
end
|
||||
|
||||
TagImplication.destroy_all("antecedent_name = consequent_name")
|
||||
TagImplication.find_each do |impl|
|
||||
impl.update_descendant_names!
|
||||
end
|
||||
|
||||
@@ -3179,14 +3179,14 @@ CREATE TABLE user_password_reset_nonces (
|
||||
created_at timestamp without time zone,
|
||||
updated_at timestamp without time zone
|
||||
);
|
||||
ALTER TABLE public.user_password_reset_nonces OWNER TO ayi;
|
||||
ALTER TABLE public.user_password_reset_nonces OWNER TO danbooru;
|
||||
CREATE SEQUENCE user_password_reset_nonces_id_seq
|
||||
START WITH 1
|
||||
INCREMENT BY 1
|
||||
NO MINVALUE
|
||||
NO MAXVALUE
|
||||
CACHE 1;
|
||||
ALTER TABLE public.user_password_reset_nonces_id_seq OWNER TO ayi;
|
||||
ALTER TABLE public.user_password_reset_nonces_id_seq OWNER TO danbooru;
|
||||
ALTER SEQUENCE user_password_reset_nonces_id_seq OWNED BY user_password_reset_nonces.id;
|
||||
ALTER TABLE user_password_reset_nonces ALTER COLUMN id SET DEFAULT nextval('user_password_reset_nonces_id_seq'::regclass);
|
||||
ALTER TABLE ONLY user_password_reset_nonces
|
||||
|
||||
Reference in New Issue
Block a user