summaryrefslogtreecommitdiff
path: root/config/initializers
diff options
context:
space:
mode:
Diffstat (limited to 'config/initializers')
-rw-r--r--config/initializers/arel_patch.rb12
-rw-r--r--config/initializers/will_paginate_patch.rb13
2 files changed, 13 insertions, 12 deletions
diff --git a/config/initializers/arel_patch.rb b/config/initializers/arel_patch.rb
deleted file mode 100644
index 753a72b..0000000
--- a/config/initializers/arel_patch.rb
+++ /dev/null
@@ -1,12 +0,0 @@
1require 'arel'
2module Arel
3 module Visitors
4 [ToSql, DepthFirst].each do |visitor|
5 visitor.class_eval do
6 def visit_Integer(o, collector = nil)
7 collector ? collector << o.to_s : o.to_s
8 end
9 end
10 end
11 end
12end
diff --git a/config/initializers/will_paginate_patch.rb b/config/initializers/will_paginate_patch.rb
new file mode 100644
index 0000000..d03c882
--- /dev/null
+++ b/config/initializers/will_paginate_patch.rb
@@ -0,0 +1,13 @@
1require 'will_paginate/view_helpers/action_view'
2
3WillPaginate::ActionView::LinkRenderer.class_eval do
4 def url(page)
5 path = @template.request.path
6 page_param = WillPaginate::PageNumber(page)
7 if page_param == 1
8 path
9 else
10 "#{path}?#{@options[:param_name]}=#{page}"
11 end
12 end
13end