Fix Rails 4.1 migration issues
This commit is contained in:
@@ -69,6 +69,9 @@ protected
|
|||||||
fmt.json do
|
fmt.json do
|
||||||
render :json => {:success => false, :reason => "access denied"}.to_json, :status => 403
|
render :json => {:success => false, :reason => "access denied"}.to_json, :status => 403
|
||||||
end
|
end
|
||||||
|
fmt.js do
|
||||||
|
render :nothing => true, :status => 403
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -106,10 +109,15 @@ protected
|
|||||||
|
|
||||||
def normalize_search
|
def normalize_search
|
||||||
if request.get?
|
if request.get?
|
||||||
params[:search] ||= {}
|
if params[:search].blank?
|
||||||
changed = params[:search].reject! {|k,v| v.blank?}
|
params[:search] = {}
|
||||||
unless changed.nil?
|
end
|
||||||
redirect_to params
|
|
||||||
|
if params[:search].is_a?(Hash)
|
||||||
|
changed = params[:search].reject! {|k,v| v.blank?}
|
||||||
|
unless changed.nil?
|
||||||
|
redirect_to params
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -431,4 +431,8 @@ class Artist < ActiveRecord::Base
|
|||||||
def deletable_by?(user)
|
def deletable_by?(user)
|
||||||
user.is_builder?
|
user.is_builder?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def visible?
|
||||||
|
!is_banned? || CurrentUser.user.is_janitor?
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ class ArtistCommentaryVersion < ActiveRecord::Base
|
|||||||
attr_accessible :post_id, :original_title, :original_description, :translated_title, :translated_description
|
attr_accessible :post_id, :original_title, :original_description, :translated_title, :translated_description
|
||||||
|
|
||||||
def self.search(params)
|
def self.search(params)
|
||||||
q = scoped
|
q = where("true")
|
||||||
params = {} if params.blank?
|
params = {} if params.blank?
|
||||||
|
|
||||||
if params[:updater_id]
|
if params[:updater_id]
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ class ModAction < ActiveRecord::Base
|
|||||||
attr_accessible :description
|
attr_accessible :description
|
||||||
|
|
||||||
def self.search(params = {})
|
def self.search(params = {})
|
||||||
q = scoped
|
q = where("true")
|
||||||
return q if params.blank?
|
return q if params.blank?
|
||||||
|
|
||||||
if params[:creator_id].present?
|
if params[:creator_id].present?
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ module PostSetPresenters
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pattern_tags
|
def pattern_tags
|
||||||
Tag.name_matches(post_set.tag_string).all(:select => "name", :limit => Danbooru.config.tag_query_limit, :order => "post_count DESC").map(&:name)
|
Tag.name_matches(post_set.tag_string).select("name").limit(Danbooru.config.tag_query_limit).order("post_count DESC").map(&:name)
|
||||||
end
|
end
|
||||||
|
|
||||||
def related_tags_for_group
|
def related_tags_for_group
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ class UserPresenter
|
|||||||
|
|
||||||
def favorites
|
def favorites
|
||||||
@favorites ||= begin
|
@favorites ||= begin
|
||||||
arel = user.favorites.limit(6).includes(:post).reorder("favorites.id desc")
|
arel = user.favorites.limit(6).joins(:post).reorder("favorites.id desc")
|
||||||
|
|
||||||
if CurrentUser.user.hide_deleted_posts?
|
if CurrentUser.user.hide_deleted_posts?
|
||||||
arel = arel.where("posts.is_deleted = false")
|
arel = arel.where("posts.is_deleted = false")
|
||||||
|
|||||||
@@ -6726,4 +6726,5 @@ INSERT INTO schema_migrations (version) VALUES ('20140111191413');
|
|||||||
|
|
||||||
INSERT INTO schema_migrations (version) VALUES ('20140204233337');
|
INSERT INTO schema_migrations (version) VALUES ('20140204233337');
|
||||||
|
|
||||||
INSERT INTO schema_migrations (version) VALUES ('20140221213349');
|
INSERT INTO schema_migrations (version) VALUES ('20140221213349');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user