Code comments and formatting

This commit is contained in:
Jon Atack 2014-12-09 00:11:21 +01:00
parent 83c8569ab3
commit 192058e969
1 changed files with 120 additions and 122 deletions

View File

@ -4,7 +4,7 @@ module Ransack
# +search_form_for+
#
# Example: <%= search_form_for(@q) do |f| %>
# <%= search_form_for(@q) do |f| %>
#
def search_form_for(record, options = {}, &proc)
if record.is_a? Ransack::Search
@ -41,7 +41,7 @@ module Ransack
# +sort_link+
#
# Example: <%= sort_link(@q, :name, [:name, 'kind ASC'], 'Player Name') %>
# <%= sort_link(@q, :name, [:name, 'kind ASC'], 'Player Name') %>
#
def sort_link(search, attribute, *args)
@search_object, routing_proxy = extract_search_obj_and_routing(search)
@ -53,10 +53,9 @@ module Ransack
private
# +sort_link+ mutations and order-dependent code are centralized here.
# Ivars are not mutated outside of this method.
# `args` are mutated in the `mutate_args!` method.
#
# `initialize_sort_link_ivars` centralizes the +sort_link+ value
# mutations and order-dependent code. No ivars are mutated outside of
# this method. `args` are mutated in the `mutate_args!` methods.
def initialize_sort_link_ivars(search, attribute, args)
@field_name = attribute.to_s
@current_dir = existing_sort_direction
@ -202,7 +201,6 @@ module Ransack
Constants::DESC
end
end
end
end
end