revert testing changes
This commit is contained in:
@@ -27,7 +27,7 @@ class UsersController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@user = User.create(params[:user], :as => :admin)
|
@user = User.create(params[:user], :as => CurrentUser.role)
|
||||||
if @user.errors.empty?
|
if @user.errors.empty?
|
||||||
session[:user_id] = @user.id
|
session[:user_id] = @user.id
|
||||||
end
|
end
|
||||||
@@ -38,7 +38,7 @@ class UsersController < ApplicationController
|
|||||||
def update
|
def update
|
||||||
@user = User.find(params[:id])
|
@user = User.find(params[:id])
|
||||||
check_privilege(@user)
|
check_privilege(@user)
|
||||||
@user.update_attributes(params[:user], :as => :admin)
|
@user.update_attributes(params[:user], :as => CurrentUser.role)
|
||||||
respond_with(@user)
|
respond_with(@user)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -328,7 +328,7 @@ class User < ActiveRecord::Base
|
|||||||
def can_upload?
|
def can_upload?
|
||||||
if is_contributor?
|
if is_contributor?
|
||||||
true
|
true
|
||||||
elsif false && created_at > 1.week.ago
|
elsif created_at > 1.week.ago
|
||||||
false
|
false
|
||||||
else
|
else
|
||||||
upload_limit > 0
|
upload_limit > 0
|
||||||
@@ -338,7 +338,7 @@ class User < ActiveRecord::Base
|
|||||||
def can_comment?
|
def can_comment?
|
||||||
if is_privileged?
|
if is_privileged?
|
||||||
true
|
true
|
||||||
elsif false && created_at > 1.week.ago
|
elsif created_at > 1.week.ago
|
||||||
false
|
false
|
||||||
else
|
else
|
||||||
Comment.where("creator_id = ? and created_at > ?", id, 1.hour.ago).count < Danbooru.config.member_comment_limit
|
Comment.where("creator_id = ? and created_at > ?", id, 1.hour.ago).count < Danbooru.config.member_comment_limit
|
||||||
|
|||||||
@@ -69,7 +69,6 @@
|
|||||||
<%= f.input :password %>
|
<%= f.input :password %>
|
||||||
<%= f.input :password_confirmation %>
|
<%= f.input :password_confirmation %>
|
||||||
<%= f.input :email, :required => false, :as => :email %>
|
<%= f.input :email, :required => false, :as => :email %>
|
||||||
<%= f.input :level, :collection => User.level_hash.to_a, :include_blank => false %>
|
|
||||||
<%= f.button :submit %>
|
<%= f.button :submit %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
alter table posts add column fav_string text not null default '';
|
alter table posts add column fav_string text not null default '';
|
||||||
alter table posts add column pool_string text not null default '';
|
alter table posts add column pool_string text not null default '';
|
||||||
update posts set fav_string = (select coalesce(string_agg('fav:' || _.user_id, ' '), '') from favorites _ where _.post_id = posts.id);
|
|
||||||
update posts set pool_string = (select coalesce(string_agg('pool:' || _.pool_id, ' '), '') from pools_posts _ where _.post_id = posts.id);
|
-- TODO: REVERT
|
||||||
|
update posts set fav_string = (select coalesce(string_agg('fav:' || _.user_id, ' '), '') from favorites _ where _.post_id = posts.id) where posts.id < 1000;
|
||||||
|
|
||||||
|
-- TODO: REVERT
|
||||||
|
update posts set pool_string = (select coalesce(string_agg('pool:' || _.pool_id, ' '), '') from pools_posts _ where _.post_id = posts.id) where posts.id < 1000;
|
||||||
|
|
||||||
create index index_advertisements_on_ad_type on advertisements (ad_type);
|
create index index_advertisements_on_ad_type on advertisements (ad_type);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user