alchemy_cms 6.0.9 → 6.0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +0 -21
  3. data/CHANGELOG.md +16 -0
  4. data/app/controllers/alchemy/admin/elements_controller.rb +3 -5
  5. data/app/controllers/alchemy/api/pages_controller.rb +3 -8
  6. data/app/controllers/alchemy/pages_controller.rb +2 -2
  7. data/app/helpers/alchemy/elements_block_helper.rb +12 -3
  8. data/app/helpers/alchemy/elements_helper.rb +4 -3
  9. data/app/helpers/alchemy/url_helper.rb +6 -3
  10. data/app/models/alchemy/content.rb +1 -0
  11. data/app/models/alchemy/element/presenters.rb +1 -1
  12. data/app/models/alchemy/essence_audio.rb +1 -0
  13. data/app/models/alchemy/essence_boolean.rb +1 -0
  14. data/app/models/alchemy/essence_date.rb +1 -0
  15. data/app/models/alchemy/essence_file.rb +1 -0
  16. data/app/models/alchemy/essence_headline.rb +1 -0
  17. data/app/models/alchemy/essence_html.rb +1 -0
  18. data/app/models/alchemy/essence_link.rb +1 -0
  19. data/app/models/alchemy/essence_node.rb +1 -0
  20. data/app/models/alchemy/essence_page.rb +1 -0
  21. data/app/models/alchemy/essence_picture.rb +1 -0
  22. data/app/models/alchemy/essence_picture_view.rb +1 -0
  23. data/app/models/alchemy/essence_richtext.rb +1 -0
  24. data/app/models/alchemy/essence_select.rb +1 -0
  25. data/app/models/alchemy/essence_text.rb +1 -0
  26. data/app/models/alchemy/essence_video.rb +1 -0
  27. data/app/models/alchemy/ingredients/boolean.rb +3 -1
  28. data/app/views/alchemy/pages/show.rss.builder +2 -2
  29. data/lib/alchemy/essence.rb +5 -1
  30. data/lib/alchemy/permissions.rb +3 -1
  31. data/lib/alchemy/version.rb +1 -1
  32. data/lib/alchemy.rb +19 -0
  33. data/lib/alchemy_cms.rb +0 -3
  34. data/package.json +1 -1
  35. metadata +3 -4
  36. data/lib/kaminari/scoped_pagination_url_helper.rb +0 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 23531a0233f0633efb7c6c17b3bb79eb6a0fd5536e34766aa76840a43c594c9b
4
- data.tar.gz: 3d8a8f2a8266b3fa5982de4009b9703d3ef3b585e1cb35ed2381daedfd110395
3
+ metadata.gz: dc9b537e2e01fab999228f1a8813bbd0c905d521639eeeb1413021c70e5add7e
4
+ data.tar.gz: 6d93f0bb79d91d05a6cda0d9a1f6697fada5cd2de30bc11b7e5c879f98ebd1a4
5
5
  SHA512:
6
- metadata.gz: 8ceb3ac0a3f6f833f5c15bfe3bc91d1e42970a03f32c373941d57574405395906fcfa16e373f2cc6db71648a93cfa6e7d37f479dc230f716270aba6539dcc62d
7
- data.tar.gz: 02d7428a535cef3b642edec8cdfb2cc7ed77360ea5033de128c2da899d28a24819cbe3026b2dd21a98f280faf505caa76745a103800a0401c5d96f42ae31fcd4
6
+ metadata.gz: 9640f98ba68fb3b85dcdf7edb966911eb148448838259981576f0f5da1e8a6511b2adf6c72753c5396b13ae7d3d42776ac160db9e5793b6b34f4cb5296e28910
7
+ data.tar.gz: 59ab7f7c6097b79df1971212cae17cc587aadb93338b8e7a8131dfdea73756bb3e0ec0b5fd68726769b829e326b346bd0ce9832764bd613af131a4b21dfb8a76
@@ -9,11 +9,9 @@ jobs:
9
9
  fail-fast: false
10
10
  matrix:
11
11
  rails:
12
- - "6.0"
13
12
  - "6.1"
14
13
  - "7.0"
15
14
  ruby:
16
- - "2.6"
17
15
  - "2.7"
18
16
  - "3.0"
19
17
  - "3.1"
@@ -21,25 +19,6 @@ jobs:
21
19
  - mysql
22
20
  - postgresql
23
21
  - mariadb
24
- exclude:
25
- - rails: "6.0"
26
- ruby: "3.1"
27
- database: mysql
28
- - rails: "6.0"
29
- ruby: "3.1"
30
- database: postgresql
31
- - rails: "6.0"
32
- ruby: "3.1"
33
- database: mariadb
34
- - rails: "7.0"
35
- ruby: "2.6"
36
- database: mysql
37
- - rails: "7.0"
38
- ruby: "2.6"
39
- database: postgresql
40
- - rails: "7.0"
41
- ruby: "2.6"
42
- database: mariadb
43
22
  env:
44
23
  DB: ${{ matrix.database }}
45
24
  DB_USER: alchemy_user
data/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## 6.0.11 (2022-09-22)
2
+
3
+ - Do not touch pages when toggling element [#2377](https://github.com/AlchemyCMS/alchemy_cms/pull/2377) ([tvdeyen](https://github.com/tvdeyen))
4
+ - Remove unused Kaminari::Helpers::Tag hack [#2376](https://github.com/AlchemyCMS/alchemy_cms/pull/2376) ([tvdeyen](https://github.com/tvdeyen))
5
+
6
+ ## 6.0.10 (2022-09-04)
7
+
8
+ - Deprecate essence classes [#2371](https://github.com/AlchemyCMS/alchemy_cms/pull/2371) ([tvdeyen](https://github.com/tvdeyen))
9
+ - Deprecate full_url_for_element helper [#2368](https://github.com/AlchemyCMS/alchemy_cms/pull/2368) ([tvdeyen](https://github.com/tvdeyen))
10
+ - Deprecate element_dom_id helper [#2368](https://github.com/AlchemyCMS/alchemy_cms/pull/2368) ([tvdeyen](https://github.com/tvdeyen))
11
+ - Use position instead of id for element dom_id [#2368](https://github.com/AlchemyCMS/alchemy_cms/pull/2368) ([tvdeyen](https://github.com/tvdeyen))
12
+ - Fix ingredient boolean preview text [#2367](https://github.com/AlchemyCMS/alchemy_cms/pull/2367) ([tvdeyen](https://github.com/tvdeyen))
13
+ - Decide locale prefix with page language in show_alchemy_page_url helper [#2366](https://github.com/AlchemyCMS/alchemy_cms/pull/2366) ([tvdeyen](https://github.com/tvdeyen))
14
+ - Use cache_key_with_version in page_etag [#2365](https://github.com/AlchemyCMS/alchemy_cms/pull/2365) ([tvdeyen](https://github.com/tvdeyen))
15
+ - Fix author edit_content permissions [#2364](https://github.com/AlchemyCMS/alchemy_cms/pull/2364) ([tvdeyen](https://github.com/tvdeyen))
16
+
1
17
  ## 6.0.9 (2022-07-25)
2
18
 
3
19
  - Allow Site managers to remove page locks [#2360](https://github.com/AlchemyCMS/alchemy_cms/pull/2360) ([mamhoff](https://github.com/mamhoff))
@@ -90,14 +90,12 @@ module Alchemy
90
90
  end
91
91
  end
92
92
 
93
- # Toggle fodls the element and persists the state in the db
93
+ # Toggle folds the element and persists the state in the db
94
94
  #
95
- # Ingredient validations might make the element invalid.
96
- # In this case we are just toggling a UI state and do not care about the validations.
97
95
  def fold
98
96
  @page = @element.page
99
- @element.folded = !@element.folded
100
- @element.save(validate: false)
97
+ # We do not want to trigger the touch callback or any validations
98
+ @element.update_columns(folded: !@element.folded)
101
99
  end
102
100
 
103
101
  private
@@ -8,14 +8,9 @@ module Alchemy
8
8
  # Returns all pages as json object
9
9
  #
10
10
  def index
11
- # Fix for cancancan not able to merge multiple AR scopes for logged in users
12
- if can? :edit_content, Alchemy::Page
13
- @pages = Alchemy::Page.all
14
- else
15
- language = Alchemy::Language.find_by(id: params[:language_id]) || Alchemy::Language.current
16
- @pages = Alchemy::Page.accessible_by(current_ability, :index)
17
- @pages = @pages.where(language: language)
18
- end
11
+ language = Alchemy::Language.find_by(id: params[:language_id]) || Alchemy::Language.current
12
+ @pages = Alchemy::Page.accessible_by(current_ability, :index)
13
+ @pages = @pages.where(language: language)
19
14
  @pages = @pages.includes(*page_includes)
20
15
  @pages = @pages.ransack(params[:q]).result
21
16
 
@@ -218,12 +218,12 @@ module Alchemy
218
218
  #
219
219
  # IMPORTANT:
220
220
  #
221
- # If your user does not have a +cache_key+ method (i.e. it's not an ActiveRecord model),
221
+ # If your user does not have a +cache_key_with_version+ method (i.e. it's not an ActiveRecord model),
222
222
  # you have to ensure to implement it and return a unique identifier for that particular user.
223
223
  # Otherwise all users will see the same cached page, regardless of user's state.
224
224
  #
225
225
  def page_etag
226
- @page.cache_key + current_alchemy_user.try(:cache_key).to_s
226
+ [@page, current_alchemy_user]
227
227
  end
228
228
 
229
229
  # We only render the page if either the cache is disabled for this page
@@ -29,9 +29,16 @@ module Alchemy
29
29
  # If the element uses +ingredients+ it renders the ingredient record.
30
30
  #
31
31
  def render(name, options = {}, html_options = {})
32
- renderable = element.ingredient_by_role(name) || content(name)
32
+ renderable = element.ingredient_by_role(name) || Alchemy::Deprecation.silence { content(name) }
33
33
  return if renderable.nil?
34
34
 
35
+ if Alchemy::DEPRECATED_ESSENCE_CLASSES.include?(renderable.try(:essence)&.class&.name)
36
+ Alchemy::Deprecation.warn(
37
+ "Using a '#{renderable.essence.class.name.demodulize}' content is deprecated. " \
38
+ "Please use a '#{Alchemy::DEPRECATED_ESSENCE_CLASS_MAPPING[renderable.essence.class.name].demodulize}' ingredient instead."
39
+ )
40
+ end
41
+
35
42
  helpers.render(renderable, {
36
43
  options: options,
37
44
  html_options: html_options,
@@ -66,7 +73,9 @@ module Alchemy
66
73
  if element.ingredient_definitions.any?
67
74
  element.has_value_for?(name)
68
75
  else
69
- element.has_ingredient?(name)
76
+ Alchemy::Deprecation.silence do
77
+ element.has_ingredient?(name)
78
+ end
70
79
  end
71
80
  end
72
81
 
@@ -128,7 +137,7 @@ module Alchemy
128
137
  def element_view_for(element, options = {})
129
138
  options = {
130
139
  tag: :div,
131
- id: element_dom_id(element),
140
+ id: element.dom_id,
132
141
  class: element.name,
133
142
  tags_formatter: ->(tags) { tags.join(" ") },
134
143
  }.merge(options)
@@ -167,12 +167,13 @@ module Alchemy
167
167
  end
168
168
 
169
169
  # Returns a string for the id attribute of a html element for the given element
170
+ # @deprecated
170
171
  def element_dom_id(element)
171
- return "" if element.nil?
172
-
173
- "#{element.name}_#{element.id}".html_safe
172
+ element&.dom_id
174
173
  end
175
174
 
175
+ deprecate element_dom_id: "element.dom_id", deprecator: Alchemy::Deprecation
176
+
176
177
  # Renders the HTML tag attributes required for preview mode.
177
178
  def element_preview_code(element)
178
179
  tag_builder.tag_options(element_preview_code_attributes(element))
@@ -20,8 +20,8 @@ module Alchemy
20
20
  def show_page_path_params(page, optional_params = {})
21
21
  raise ArgumentError, "Page is nil" if page.nil?
22
22
 
23
- url_params = {urlname: page.urlname}.update(optional_params)
24
- prefix_locale? ? url_params.update(locale: page.language_code) : url_params
23
+ url_params = { urlname: page.urlname }.update(optional_params)
24
+ prefix_locale?(page.language_code) ? url_params.update(locale: page.language_code) : url_params
25
25
  end
26
26
 
27
27
  # Returns the path for downloading an alchemy attachment
@@ -35,8 +35,11 @@ module Alchemy
35
35
  end
36
36
 
37
37
  # Returns the full url containing host, page and anchor for the given element
38
+ # @deprecated
38
39
  def full_url_for_element(element)
39
- "#{current_server}/#{element.page.urlname}##{element_dom_id(element)}"
40
+ "#{current_server}/#{element.page.urlname}##{element.dom_id}"
40
41
  end
42
+
43
+ deprecate :full_url_for_element, deprecator: Alchemy::Deprecation
41
44
  end
42
45
  end
@@ -19,6 +19,7 @@
19
19
  require_dependency "alchemy/content/factory"
20
20
 
21
21
  module Alchemy
22
+ # @deprecated
22
23
  class Content < BaseRecord
23
24
  include Alchemy::Logger
24
25
  include Alchemy::Hints
@@ -82,7 +82,7 @@ module Alchemy
82
82
  # Returns a dom id used for elements html id tag.
83
83
  #
84
84
  def dom_id
85
- "#{name}_#{id}"
85
+ [parent_element&.dom_id, name, position].compact.join("-")
86
86
  end
87
87
 
88
88
  # The content that's used for element's preview text.
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
+ # @deprecated
4
5
  class EssenceAudio < ActiveRecord::Base
5
6
  acts_as_essence(
6
7
  ingredient_column: :attachment,
@@ -13,6 +13,7 @@
13
13
  # Stores boolean values.
14
14
  # Provides a checkbox in the editor views.
15
15
  module Alchemy
16
+ # @deprecated
16
17
  class EssenceBoolean < BaseRecord
17
18
  acts_as_essence ingredient_column: "value"
18
19
  end
@@ -11,6 +11,7 @@
11
11
  #
12
12
 
13
13
  module Alchemy
14
+ # @deprecated
14
15
  class EssenceDate < BaseRecord
15
16
  acts_as_essence ingredient_column: "date"
16
17
 
@@ -14,6 +14,7 @@
14
14
  #
15
15
 
16
16
  module Alchemy
17
+ # @deprecated
17
18
  class EssenceFile < BaseRecord
18
19
  belongs_to :attachment, optional: true
19
20
  acts_as_essence ingredient_column: "attachment"
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
+ # @deprecated
4
5
  class EssenceHeadline < BaseRecord
5
6
  acts_as_essence
6
7
 
@@ -11,6 +11,7 @@
11
11
  #
12
12
 
13
13
  module Alchemy
14
+ # @deprecated
14
15
  class EssenceHtml < BaseRecord
15
16
  acts_as_essence ingredient_column: "source"
16
17
 
@@ -14,6 +14,7 @@
14
14
  #
15
15
 
16
16
  module Alchemy
17
+ # @deprecated
17
18
  class EssenceLink < BaseRecord
18
19
  acts_as_essence ingredient_column: "link"
19
20
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
+ # @deprecated
4
5
  class EssenceNode < BaseRecord
5
6
  acts_as_essence(
6
7
  ingredient_column: :node,
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
+ # @deprecated
4
5
  class EssencePage < BaseRecord
5
6
  acts_as_essence(
6
7
  ingredient_column: :page,
@@ -22,6 +22,7 @@
22
22
  #
23
23
 
24
24
  module Alchemy
25
+ # @deprecated
25
26
  class EssencePicture < BaseRecord
26
27
  include Alchemy::PictureThumbnails
27
28
 
@@ -2,6 +2,7 @@
2
2
 
3
3
  module Alchemy
4
4
  # Renders an essence picture view
5
+ # @deprecated
5
6
  class EssencePictureView
6
7
  include ActionView::Helpers::AssetTagHelper
7
8
  include ActionView::Helpers::UrlHelper
@@ -13,6 +13,7 @@
13
13
  #
14
14
 
15
15
  module Alchemy
16
+ # @deprecated
16
17
  class EssenceRichtext < BaseRecord
17
18
  acts_as_essence preview_text_column: "stripped_body"
18
19
 
@@ -12,6 +12,7 @@
12
12
 
13
13
  # Provides a select box that stores string values.
14
14
  module Alchemy
15
+ # @deprecated
15
16
  class EssenceSelect < BaseRecord
16
17
  acts_as_essence ingredient_column: "value"
17
18
  end
@@ -16,6 +16,7 @@
16
16
  #
17
17
 
18
18
  module Alchemy
19
+ # @deprecated
19
20
  class EssenceText < BaseRecord
20
21
  acts_as_essence
21
22
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
+ # @deprecated
4
5
  class EssenceVideo < ActiveRecord::Base
5
6
  acts_as_essence(
6
7
  ingredient_column: :attachment,
@@ -14,7 +14,9 @@ module Alchemy
14
14
  # Used by the Element#preview_text method.
15
15
  #
16
16
  def preview_text(_max_length = nil)
17
- Alchemy.t(value, scope: "ingredient_values.boolean")
17
+ return if value.nil?
18
+
19
+ Alchemy.t(value.to_s, scope: "ingredient_values.boolean")
18
20
  end
19
21
  end
20
22
  end
@@ -13,8 +13,8 @@ xml.rss version: "2.0" do
13
13
  if element.has_ingredient?("date")
14
14
  xml.pubDate element.ingredient("date").to_s(:rfc822)
15
15
  end
16
- xml.link show_alchemy_page_url(@page, anchor: element_dom_id(element))
17
- xml.guid show_alchemy_page_url(@page, anchor: element_dom_id(element))
16
+ xml.link show_alchemy_page_url(@page, anchor: "##{element.dom_id}")
17
+ xml.guid show_alchemy_page_url(@page, anchor: "##{element.dom_id}")
18
18
  end
19
19
  end
20
20
  end
@@ -23,8 +23,12 @@ module Alchemy #:nodoc:
23
23
  # The column the the validations run against.
24
24
  # @option options [String || Symbol] preview_text_column (ingredient_column)
25
25
  # Specify the column for the preview_text method.
26
- #
26
+ # @deprecated
27
27
  def acts_as_essence(options = {})
28
+ if !DEPRECATED_ESSENCE_CLASSES.include?(name)
29
+ Alchemy::Deprecation.warn "Please create a custom Alchemy::Ingredient for #{name} instead"
30
+ end
31
+
28
32
  register_as_essence_association!
29
33
 
30
34
  configuration = {
@@ -121,7 +121,9 @@ module Alchemy
121
121
  can :manage, Alchemy::Node
122
122
  can [:read, :url], Alchemy::Picture
123
123
  can [:read, :autocomplete], Alchemy::Tag
124
- can(:edit_content, Alchemy::Page) { |p| p.editable_by?(@user) }
124
+ can :edit_content, Alchemy::Page, Alchemy::Page.all do |page|
125
+ page.editable_by?(@user)
126
+ end
125
127
  end
126
128
  end
127
129
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
- VERSION = "6.0.9"
4
+ VERSION = "6.0.11"
5
5
 
6
6
  def self.version
7
7
  VERSION
data/lib/alchemy.rb CHANGED
@@ -5,6 +5,25 @@ require "alchemy/admin/preview_url"
5
5
  module Alchemy
6
6
  YAML_PERMITTED_CLASSES = %w[Symbol Date Regexp]
7
7
 
8
+ DEPRECATED_ESSENCE_CLASS_MAPPING = {
9
+ "Alchemy::EssenceAudio" => "Alchemy::Ingredients::Audio",
10
+ "Alchemy::EssenceBoolean" => "Alchemy::Ingredients::Boolean",
11
+ "Alchemy::EssenceDate" => "Alchemy::Ingredients::Date",
12
+ "Alchemy::EssenceFile" => "Alchemy::Ingredients::File",
13
+ "Alchemy::EssenceHeadline" => "Alchemy::Ingredients::Headline",
14
+ "Alchemy::EssenceHtml" => "Alchemy::Ingredients::Html",
15
+ "Alchemy::EssenceLink" => "Alchemy::Ingredients::Link",
16
+ "Alchemy::EssenceNode" => "Alchemy::Ingredients::Node",
17
+ "Alchemy::EssencePage" => "Alchemy::Ingredients::Page",
18
+ "Alchemy::EssencePicture" => "Alchemy::Ingredients::Picture",
19
+ "Alchemy::EssenceRichtext" => "Alchemy::Ingredients::Richtext",
20
+ "Alchemy::EssenceSelect" => "Alchemy::Ingredients::Select",
21
+ "Alchemy::EssenceText" => "Alchemy::Ingredients::Text",
22
+ "Alchemy::EssenceVideo" => "Alchemy::Ingredients::Video",
23
+ }
24
+
25
+ DEPRECATED_ESSENCE_CLASSES = DEPRECATED_ESSENCE_CLASS_MAPPING.keys
26
+
8
27
  # Define page preview sources
9
28
  #
10
29
  # A preview source is a Ruby class returning an URL
data/lib/alchemy_cms.rb CHANGED
@@ -57,8 +57,5 @@ require_relative "alchemy/tinymce"
57
57
  require_relative "alchemy/taggable"
58
58
  require_relative "alchemy/version"
59
59
 
60
- # Require hacks
61
- require_relative "kaminari/scoped_pagination_url_helper"
62
-
63
60
  # Finally require Alchemy itself
64
61
  require_relative "alchemy/engine"
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alchemy_cms/admin",
3
- "version": "6.0.9",
3
+ "version": "6.0.11",
4
4
  "description": "AlchemyCMS",
5
5
  "browser": "package/admin.js",
6
6
  "files": [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alchemy_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.9
4
+ version: 6.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas von Deyen
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2022-07-25 00:00:00.000000000 Z
16
+ date: 2022-09-22 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: actionmailer
@@ -1419,7 +1419,6 @@ files:
1419
1419
  - lib/generators/alchemy/site_layouts/templates/layout.html.haml
1420
1420
  - lib/generators/alchemy/site_layouts/templates/layout.html.slim
1421
1421
  - lib/generators/alchemy/views/views_generator.rb
1422
- - lib/kaminari/scoped_pagination_url_helper.rb
1423
1422
  - lib/tasks/alchemy/db.rake
1424
1423
  - lib/tasks/alchemy/install.rake
1425
1424
  - lib/tasks/alchemy/thumbnails.rake
@@ -1525,7 +1524,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1525
1524
  version: '0'
1526
1525
  requirements:
1527
1526
  - ImageMagick (libmagick), v6.6 or greater.
1528
- rubygems_version: 3.1.6
1527
+ rubygems_version: 3.3.7
1529
1528
  signing_key:
1530
1529
  specification_version: 4
1531
1530
  summary: A powerful, userfriendly and flexible CMS for Rails
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
- # A Kaminari patch for scoping the urls.
3
- Kaminari::Helpers::Tag.class_eval do
4
- def page_url_for(page)
5
- params = @params.merge(@param_name => (page <= 1 ? nil : page))
6
- if @options[:scope]
7
- @options[:scope].url_for params
8
- else
9
- @template.url_for params
10
- end
11
- end
12
- end