revert testing changes

This commit is contained in:
albert
2011-11-18 18:09:23 -05:00
parent 46236e32a5
commit 1d4ce259a8
4 changed files with 10 additions and 7 deletions

View File

@@ -27,7 +27,7 @@ class UsersController < ApplicationController
end
def create
@user = User.create(params[:user], :as => :admin)
@user = User.create(params[:user], :as => CurrentUser.role)
if @user.errors.empty?
session[:user_id] = @user.id
end
@@ -38,7 +38,7 @@ class UsersController < ApplicationController
def update
@user = User.find(params[:id])
check_privilege(@user)
@user.update_attributes(params[:user], :as => :admin)
@user.update_attributes(params[:user], :as => CurrentUser.role)
respond_with(@user)
end

View File

@@ -328,7 +328,7 @@ class User < ActiveRecord::Base
def can_upload?
if is_contributor?
true
elsif false && created_at > 1.week.ago
elsif created_at > 1.week.ago
false
else
upload_limit > 0
@@ -338,7 +338,7 @@ class User < ActiveRecord::Base
def can_comment?
if is_privileged?
true
elsif false && created_at > 1.week.ago
elsif created_at > 1.week.ago
false
else
Comment.where("creator_id = ? and created_at > ?", id, 1.hour.ago).count < Danbooru.config.member_comment_limit

View File

@@ -69,7 +69,6 @@
<%= f.input :password %>
<%= f.input :password_confirmation %>
<%= f.input :email, :required => false, :as => :email %>
<%= f.input :level, :collection => User.level_hash.to_a, :include_blank => false %>
<%= f.button :submit %>
<% end %>
</div>

View File

@@ -1,7 +1,11 @@
alter table posts add column fav_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);