mirror of
https://github.com/moebooru/moebooru
synced 2025-09-01 06:25:13 +00:00
Remove trailing comma of last item.
This commit is contained in:
@@ -150,7 +150,7 @@ class HistoryController < ApplicationController
|
|||||||
@options = {
|
@options = {
|
||||||
:show_all_tags => params[:show_all_tags] == "1",
|
:show_all_tags => params[:show_all_tags] == "1",
|
||||||
:specific_object => (q.key?(:type) && q.key?(:id)),
|
:specific_object => (q.key?(:type) && q.key?(:id)),
|
||||||
:specific_history => q.key?(:change),
|
:specific_history => q.key?(:change)
|
||||||
}
|
}
|
||||||
|
|
||||||
@options[:show_name] = false
|
@options[:show_name] = false
|
||||||
|
@@ -10,7 +10,7 @@ module HistoryHelper
|
|||||||
# :show_all_tags: Show unchanged tags.
|
# :show_all_tags: Show unchanged tags.
|
||||||
def get_default_field_options
|
def get_default_field_options
|
||||||
@default_field_options ||= {
|
@default_field_options ||= {
|
||||||
:suppress_fields => [],
|
:suppress_fields => []
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ module HistoryHelper
|
|||||||
:Post => {
|
:Post => {
|
||||||
:fields => {
|
:fields => {
|
||||||
:cached_tags => { :primary_order => 2 }, # show tag changes after other things
|
:cached_tags => { :primary_order => 2 }, # show tag changes after other things
|
||||||
:source => { :primary_order => 3 },
|
:source => { :primary_order => 3 }
|
||||||
},
|
},
|
||||||
:never_obsolete => { :cached_tags => true } # tags handle obsolete themselves per-tag
|
:never_obsolete => { :cached_tags => true } # tags handle obsolete themselves per-tag
|
||||||
},
|
},
|
||||||
@@ -70,15 +70,15 @@ module HistoryHelper
|
|||||||
:suppress_fields => [:sequence], # changing active usually changes sequence; this isn't interesting
|
:suppress_fields => [:sequence], # changing active usually changes sequence; this isn't interesting
|
||||||
:primary_order => 2, # show pool post changes after other things
|
:primary_order => 2, # show pool post changes after other things
|
||||||
},
|
},
|
||||||
:cached_tags => {},
|
:cached_tags => {}
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
:Tag => {
|
:Tag => {
|
||||||
},
|
},
|
||||||
|
|
||||||
:Note => {
|
:Note => {
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@att_options.each_key do |classname|
|
@att_options.each_key do |classname|
|
||||||
@@ -86,7 +86,7 @@ module HistoryHelper
|
|||||||
:fields => {},
|
:fields => {},
|
||||||
:primary_order => 1,
|
:primary_order => 1,
|
||||||
:never_obsolete => {},
|
:never_obsolete => {},
|
||||||
:force_show_initial => {},
|
:force_show_initial => {}
|
||||||
}.merge(@att_options[classname])
|
}.merge(@att_options[classname])
|
||||||
|
|
||||||
c = @att_options[classname][:fields]
|
c = @att_options[classname][:fields]
|
||||||
@@ -400,7 +400,7 @@ module HistoryHelper
|
|||||||
{
|
{
|
||||||
:html => span,
|
:html => span,
|
||||||
:field => change.column_name,
|
:field => change.column_name,
|
||||||
:sort_key => sort_key,
|
:sort_key => sort_key
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@@ -15,7 +15,7 @@ module PoolHelper
|
|||||||
def link_to_pool_zip(text, pool, zip_params, options = {})
|
def link_to_pool_zip(text, pool, zip_params, options = {})
|
||||||
text = "%s%s (%s)" % [text,
|
text = "%s%s (%s)" % [text,
|
||||||
options[:has_jpeg] ? " PNGs" : "",
|
options[:has_jpeg] ? " PNGs" : "",
|
||||||
number_to_human_size(pool.get_zip_size(zip_params).to_i),
|
number_to_human_size(pool.get_zip_size(zip_params).to_i)
|
||||||
]
|
]
|
||||||
options = { :action => "zip", :id => pool.id, :filename => pool.get_zip_filename(zip_params) }
|
options = { :action => "zip", :id => pool.id, :filename => pool.get_zip_filename(zip_params) }
|
||||||
options[:jpeg] = 1 if zip_params[:jpeg]
|
options[:jpeg] = 1 if zip_params[:jpeg]
|
||||||
|
@@ -37,7 +37,7 @@ class FlaggedPostDetail < ActiveRecord::Base
|
|||||||
ret = {
|
ret = {
|
||||||
:post_id => post_id,
|
:post_id => post_id,
|
||||||
:reason => reason,
|
:reason => reason,
|
||||||
:created_at => created_at,
|
:created_at => created_at
|
||||||
}
|
}
|
||||||
|
|
||||||
unless hide_user then
|
unless hide_user then
|
||||||
|
@@ -321,7 +321,7 @@ class InlineImage < ActiveRecord::Base
|
|||||||
:description => description,
|
:description => description,
|
||||||
:file_url => file_url,
|
:file_url => file_url,
|
||||||
:sample_url => sample_url,
|
:sample_url => sample_url,
|
||||||
:preview_url => preview_url,
|
:preview_url => preview_url
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@@ -160,7 +160,7 @@ class Pool < ActiveRecord::Base
|
|||||||
:user_id => user_id,
|
:user_id => user_id,
|
||||||
:is_public => is_public,
|
:is_public => is_public,
|
||||||
:post_count => post_count,
|
:post_count => post_count,
|
||||||
:description => description,
|
:description => description
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@@ -42,7 +42,7 @@ class PoolPost < ActiveRecord::Base
|
|||||||
:active => active,
|
:active => active,
|
||||||
:sequence => sequence,
|
:sequence => sequence,
|
||||||
:next_post_id => next_post_id,
|
:next_post_id => next_post_id,
|
||||||
:prev_post_id => prev_post_id,
|
:prev_post_id => prev_post_id
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@@ -38,7 +38,7 @@ module Post::ApiMethods
|
|||||||
:frames_pending_string => frames_pending,
|
:frames_pending_string => frames_pending,
|
||||||
:frames_pending => frames_api_data(frames_pending),
|
:frames_pending => frames_api_data(frames_pending),
|
||||||
:frames_string => frames,
|
:frames_string => frames,
|
||||||
:frames => frames_api_data(frames),
|
:frames => frames_api_data(frames)
|
||||||
}
|
}
|
||||||
|
|
||||||
if status == "deleted"
|
if status == "deleted"
|
||||||
@@ -74,7 +74,7 @@ module Post::ApiMethods
|
|||||||
def api_data
|
def api_data
|
||||||
{
|
{
|
||||||
:post => self,
|
:post => self,
|
||||||
:tags => Tag.batch_get_tag_types_for_posts([self]),
|
:tags => Tag.batch_get_tag_types_for_posts([self])
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@@ -42,7 +42,7 @@ module Post::TagMethods
|
|||||||
:removed_tags => old_tags - new_tags,
|
:removed_tags => old_tags - new_tags,
|
||||||
:unchanged_tags => new_tags & old_tags,
|
:unchanged_tags => new_tags & old_tags,
|
||||||
:obsolete_added_tags => (new_tags - old_tags) - latest_tags,
|
:obsolete_added_tags => (new_tags - old_tags) - latest_tags,
|
||||||
:obsolete_removed_tags => (old_tags - new_tags) & latest_tags,
|
:obsolete_removed_tags => (old_tags - new_tags) & latest_tags
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@@ -80,7 +80,7 @@ class PostTagHistory < ActiveRecord::Base
|
|||||||
:removed_tags => old_tags - new_tags,
|
:removed_tags => old_tags - new_tags,
|
||||||
:unchanged_tags => new_tags & old_tags,
|
:unchanged_tags => new_tags & old_tags,
|
||||||
:obsolete_added_tags => (new_tags - old_tags) - latest_tags,
|
:obsolete_added_tags => (new_tags - old_tags) - latest_tags,
|
||||||
:obsolete_removed_tags => (old_tags - new_tags) & latest_tags,
|
:obsolete_removed_tags => (old_tags - new_tags) & latest_tags
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@@ -174,7 +174,7 @@ CONFIG["local_image_service"] = ""
|
|||||||
CONFIG["image_service_list"] = {
|
CONFIG["image_service_list"] = {
|
||||||
"danbooru.donmai.us" => "http://haruhidoujins.yi.org/multi-search.xml",
|
"danbooru.donmai.us" => "http://haruhidoujins.yi.org/multi-search.xml",
|
||||||
"moe.imouto.org" => "http://haruhidoujins.yi.org/multi-search.xml",
|
"moe.imouto.org" => "http://haruhidoujins.yi.org/multi-search.xml",
|
||||||
"konachan.com" => "http://haruhidoujins.yi.org/multi-search.xml",
|
"konachan.com" => "http://haruhidoujins.yi.org/multi-search.xml"
|
||||||
}
|
}
|
||||||
|
|
||||||
# If true, image services receive a URL to the thumbnail for searching, which
|
# If true, image services receive a URL to the thumbnail for searching, which
|
||||||
|
@@ -110,5 +110,5 @@ CONFIG["language_names"] = {
|
|||||||
"en" => "English",
|
"en" => "English",
|
||||||
"zh" => "Chinese",
|
"zh" => "Chinese",
|
||||||
"ja" => "Japanese",
|
"ja" => "Japanese",
|
||||||
"es" => "Spanish",
|
"es" => "Spanish"
|
||||||
}
|
}
|
||||||
|
@@ -57,14 +57,14 @@ module SimilarImages
|
|||||||
if search_url
|
if search_url
|
||||||
params += [{
|
params += [{
|
||||||
:name => "url",
|
:name => "url",
|
||||||
:data => search_url,
|
:data => search_url
|
||||||
}]
|
}]
|
||||||
else
|
else
|
||||||
params += [{
|
params += [{
|
||||||
:name => "file",
|
:name => "file",
|
||||||
:binary => true,
|
:binary => true,
|
||||||
:data => source_file,
|
:data => source_file,
|
||||||
:filename => File.basename(source_filename),
|
:filename => File.basename(source_filename)
|
||||||
}]
|
}]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@@ -150,7 +150,7 @@ module ActiveRecord
|
|||||||
opt = {
|
opt = {
|
||||||
:class => to_s.to_sym,
|
:class => to_s.to_sym,
|
||||||
:controller => to_s,
|
:controller => to_s,
|
||||||
:action => "show",
|
:action => "show"
|
||||||
}.merge(options)
|
}.merge(options)
|
||||||
|
|
||||||
unless opt[:foreign_key]
|
unless opt[:foreign_key]
|
||||||
|
@@ -95,7 +95,7 @@ class ApplicationTest < ActiveSupport::TestCase
|
|||||||
{ :rating => "e" }, { :rating => "s" },
|
{ :rating => "e" }, { :rating => "s" },
|
||||||
|
|
||||||
# rating code path is different for metatags:
|
# rating code path is different for metatags:
|
||||||
{ :tags => "rating:e" }, { :tags => "rating:s" },
|
{ :tags => "rating:e" }, { :tags => "rating:s" }
|
||||||
],
|
],
|
||||||
# changing either way from s -> e -> s should invalidate both s and e
|
# changing either way from s -> e -> s should invalidate both s and e
|
||||||
:affected_searches => ["rating:s", "rating:e", "-rating:s", "-rating:e", "id:1", "pool:#{pool_id}"]
|
:affected_searches => ["rating:s", "rating:e", "-rating:s", "-rating:e", "id:1", "pool:#{pool_id}"]
|
||||||
@@ -114,10 +114,10 @@ class ApplicationTest < ActiveSupport::TestCase
|
|||||||
{ :tags => "pool:dummy" },
|
{ :tags => "pool:dummy" },
|
||||||
{ :tags => "-pool:dummy" },
|
{ :tags => "-pool:dummy" },
|
||||||
{ :tags => "pool:#{pool_id}" },
|
{ :tags => "pool:#{pool_id}" },
|
||||||
{ :tags => "-pool:#{pool_id}" },
|
{ :tags => "-pool:#{pool_id}" }
|
||||||
],
|
],
|
||||||
:affected_searches => ["pool:dummy", "pool:#{pool_id}"]
|
:affected_searches => ["pool:dummy", "pool:#{pool_id}"]
|
||||||
},
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
tests.each do |test|
|
tests.each do |test|
|
||||||
|
Reference in New Issue
Block a user