rao-resources_controller 0.0.47.pre → 0.0.49.pre

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2371783ce441bfb7c74932bdff959429ebb65d251cde9ca97cc08af007a4a2e1
4
- data.tar.gz: e2c107624566431ebe89eaa98e4233d3cdf43a77db53fa1ef99cf0bb6086990a
3
+ metadata.gz: 49403d74f7f8f424205b8f94e50b24c5eeded006ddad1656d35b5bdb4a0edfc8
4
+ data.tar.gz: 860e42fee2505e0f0b62063a78003e90e6522af30aa59bae78396677ff6863d4
5
5
  SHA512:
6
- metadata.gz: 3d76366e6030fd7f2e634a28b777d571af999ccde43dac26a63fb3269038d2c8d2cd90a1037809d6ddf00f9a2699ff5dbd6e1f17620206a5739b7d9bffaf3efd
7
- data.tar.gz: c19cb5464ccba957c86c525bbda7bfcaa713fcd28a420a3968176e7e95e3e90f7c23b1efd6ab6bce5ad1c8a7362e275ca6ccfacd8ccffee63e2dfee4d5ea650c
6
+ metadata.gz: 67449b0e3579bb1b00fd22a4c53f8655c1f05f1fb91e20dff37bd2320f67decbfa549aa1ce8346d21b0445433ae52fea577a0ba8c10e093c5aa34ccb58dd464e
7
+ data.tar.gz: '059aace6a67a1d8f82e8db32055223c7f088f3d83f28e8bcd42328b1c3db0ee9220caf988da6aeea30fd067988d6a688cc69564de3a797be44d765782552c477'
@@ -4,7 +4,7 @@ module Rao
4
4
 
5
5
  def reposition
6
6
  @resource = load_resource
7
- @dropped_resource = resource_class.find(params[:dropped_id])
7
+ @dropped_resource = load_resource_scope.find(params[:dropped_id])
8
8
  @dropped_resource.move_to_right_of(@resource)
9
9
 
10
10
  label_methods = [:human, :name, :email, :to_s]
@@ -25,7 +25,13 @@ module Rao
25
25
  end
26
26
  end
27
27
 
28
- redirect_to collection_path, notice: I18n.t("awesome_nested_set.flash.actions.reposition.notice", target_resource: target_resource_label, inserted_resource: inserted_resource_label)
28
+ redirect_to after_reposition_location, notice: I18n.t("awesome_nested_set.flash.actions.reposition.notice", target_resource: target_resource_label, inserted_resource: inserted_resource_label)
29
+ end
30
+
31
+ private
32
+
33
+ def after_reposition_location
34
+ collection_path
29
35
  end
30
36
  end
31
37
  end
@@ -12,10 +12,10 @@ module Rao
12
12
  count = @collection.count
13
13
  @collection.destroy_all
14
14
 
15
- default_message = t('.success', inflections.merge(count: count))
15
+ default_message = t('.success', **inflections.merge(count: count, raise: false))
16
16
  respond_with @collection,
17
17
  location: after_destroy_many_location,
18
- notice: t('rao.resources_controller.batch_actions_concern.destroy_many.success', inflections.merge(count: count, default: default_message))
18
+ notice: t('rao.resources_controller.batch_actions_concern.destroy_many.success', **inflections.merge(count: count, default: default_message))
19
19
  end
20
20
 
21
21
  private
@@ -4,13 +4,18 @@ module Rao
4
4
 
5
5
  included do
6
6
  helper_method :paginate?
7
+ helper_method :per_page
7
8
  end
9
+
10
+ private
8
11
 
9
12
  def paginate?
10
13
  true
11
14
  end
12
15
 
13
- private
16
+ def per_page_default
17
+ Rao::ResourcesController::Configuration.pagination_per_page_default
18
+ end
14
19
 
15
20
  def load_collection
16
21
  @collection = load_collection_scope.page(params[:page]).per(per_page)
@@ -19,7 +24,7 @@ module Rao
19
24
  def per_page
20
25
  # Return page size from configuration if per_page is not present in params
21
26
  unless params.has_key?(:per_page)
22
- return Rao::ResourcesController::Configuration.pagination_per_page_default
27
+ return per_page_default
23
28
  end
24
29
 
25
30
  # Return count of all records or nil if no records present if
@@ -1,4 +1,4 @@
1
- %h1= t('.title', inflections)
1
+ %h1= t('.title', **inflections)
2
2
 
3
3
  = simple_form_for(@resource, url: resource_path(@resource)) do |f|
4
4
  = render 'form_errors', resource: f.object
@@ -1,4 +1,4 @@
1
- %h1= t('.title', inflections)
1
+ %h1= t('.title', **inflections)
2
2
 
3
3
  = simple_form_for(@resource, url: collection_path) do |f|
4
4
  = render 'form_errors', resource: f.object
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rao-resources_controller
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.47.pre
4
+ version: 0.0.49.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Vasquez Angel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-25 00:00:00.000000000 Z
11
+ date: 2023-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 4.2.0
19
+ version: '6.1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 4.2.0
26
+ version: '6.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rao
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 1.3.6
61
+ version: '1.4'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 1.3.6
68
+ version: '1.4'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rails-dummy
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -203,14 +203,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
203
203
  requirements:
204
204
  - - ">="
205
205
  - !ruby/object:Gem::Version
206
- version: '0'
206
+ version: 2.6.0
207
207
  required_rubygems_version: !ruby/object:Gem::Requirement
208
208
  requirements:
209
209
  - - ">"
210
210
  - !ruby/object:Gem::Version
211
211
  version: 1.3.1
212
212
  requirements: []
213
- rubygems_version: 3.1.4
213
+ rubygems_version: 3.4.11
214
214
  signing_key:
215
215
  specification_version: 4
216
216
  summary: Resources Controllers for Ruby on Rails.