templus_models 3.0.14 → 3.0.17

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
- SHA1:
3
- metadata.gz: 5d430cf39c020a63c9cf7e16b248a1ee4c71c040
4
- data.tar.gz: cf28b29eb8f4d46fa53a1cd6cf84663f3b1f94d1
2
+ SHA256:
3
+ metadata.gz: 9d204588df378b19fe94813b2c24a13488a170704bdcac58ae5ae05142dea5d9
4
+ data.tar.gz: 24451ee6c17c9d3c4daf338a20c69ee46f83998654581e89fd9d103282a4c379
5
5
  SHA512:
6
- metadata.gz: 2fb6d1d75db08aa1656e3d8ed3216a3b0a85180fc83319e018f1da91f60b5380ad0b0b30ba61b6d9c1c1fedad6c3a23a18bd5668bd2cd9b3a469442aa7fb9b82
7
- data.tar.gz: 12aa1d2ad34d7d1c8c7374571edadf76d78488542748beb085c6bc3a0e6d392f5f66b351d237df669ad0b2fd2bf1d02dcb951249d52831ecc33ef85e8944e850
6
+ metadata.gz: abc0e462c6a9708283070512d56af53e9207980eea46039de1f9d2aed553e8b6db00b061d29e8430c3572a79ebe7780c6cafe3faba18505278315919309e7283
7
+ data.tar.gz: 5ed074ec1685c94f8dc69b48752232d7d58fed6c26f3e42f103c173cd90b74eaba5ea165740713118e4c3c8954e992161882fb2ab9c79b3e345330636bcc1236
@@ -60,7 +60,7 @@ class CrudController < ApplicationController
60
60
  else
61
61
  flash.now[:error] = I18n.t("mensagem_erro_action", acao: params[:acao])
62
62
  end
63
- redirect_to "#{@url}?page=#{params[:page]}"
63
+ redirect_to @url
64
64
  else
65
65
  @titulo = @record.to_s
66
66
  @texto = params[:acao]
@@ -83,7 +83,7 @@ class CrudController < ApplicationController
83
83
  respond_to do |format|
84
84
  if @saved
85
85
  flash[:success] = params[:id].present? ? I18n.t("updated", model: I18n.t("model.#{@model.name.underscore}")) : I18n.t("created", model: I18n.t("model.#{@model.name.underscore}"))
86
- format.html { redirect_to "#{@url}?page=#{params[:page]}" }
86
+ format.html { redirect_to @url }
87
87
  unless params[:render] == 'modal'
88
88
  format.js { render action: :index}
89
89
  else
@@ -211,9 +211,7 @@ class CrudController < ApplicationController
211
211
  end
212
212
  end
213
213
 
214
-
215
214
  private
216
-
217
215
  def setup
218
216
  params[:q] = convert_params(params[:q])
219
217
  if params[:associacao]
@@ -299,7 +297,7 @@ class CrudController < ApplicationController
299
297
  list_methods = []
300
298
  @model.ancestors.each do |m|
301
299
  list_methods << m.methods(false).reject{ |m| /^_/ =~ m.to_s }
302
- break if ["ApplicationRecord", "ActiveRecord::Base"].include? m.superclass.to_s
300
+ break if ["ApplicationRecord", "ActiveRecord::Base"].include? m.try(:superclass).to_s
303
301
  end
304
302
  list_methods.flatten.include? method.to_sym
305
303
  end
@@ -308,7 +306,7 @@ class CrudController < ApplicationController
308
306
  list_methods = []
309
307
  @model.ancestors.each do |m|
310
308
  list_methods << m.instance_methods(false).reject{ |m| /^_/ =~ m.to_s }
311
- break if ["ApplicationRecord", "ActiveRecord::Base"].include? m.superclass.to_s
309
+ break if ["ApplicationRecord", "ActiveRecord::Base"].include? m.try(:superclass).to_s
312
310
  end
313
311
  list_methods.flatten.include? method.to_sym
314
312
  end
@@ -234,13 +234,6 @@ module CrudHelper
234
234
  crud_helper.condition_printing_action.call(record)
235
235
  end
236
236
 
237
- def add_params_page(url, page)
238
- if page.present? && !url.include?("&")
239
- url = url.include?("?") ? "#{url}&page=#{page}" : "#{url}?page=#{page}"
240
- end
241
- url
242
- end
243
-
244
237
  private
245
238
 
246
239
  def pdf_image_tag(field, options = {})
@@ -60,7 +60,7 @@
60
60
  <div class="col-sm-4 col-sm-offset-2">
61
61
  <%= f.submit I18n.t("save"), class: 'btn btn-primary' %>
62
62
  <%unless params[:render] == 'modal'%>
63
- <%= link_to I18n.t("undo"), add_params_page(@url, params[:page]), class: 'btn btn-default', data: {push: 'partial', target: "#form"} %>
63
+ <%= link_to I18n.t("undo"), @url, class: 'btn btn-default', data: {push: 'partial', target: "#form"} %>
64
64
  <% end %>
65
65
  </div>
66
66
  </div>
@@ -87,7 +87,7 @@
87
87
  <% if action[:options].present? && action[:options][:wiselink].present? && action[:options][:wiselink] %>
88
88
  <% data = {push: "partial", target: "#form"} %>
89
89
  <% end %>
90
- <%= link_to I18n.t(action[:desc]), action_crud_path(model: @model.name.underscore, id: record.id, acao: action[:method]), class: "btn btn-primary btn-xs", data: data || {} %>
90
+ <%= link_to I18n.t(action[:desc]), action_crud_path(model: @model.name.underscore, id: record.id, acao: action[:method], page: params[:page], q: params[:q]), class: "btn btn-primary btn-xs", data: data || {} %>
91
91
  <% end %>
92
92
  <% end %>
93
93
  <% @crud_helper.actions_links.each do |name, options| %>
@@ -1,3 +1,3 @@
1
1
  module TemplusModels
2
- VERSION = "3.0.14"
2
+ VERSION = "3.0.17"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: templus_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.14
4
+ version: 3.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Sol
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-12-28 00:00:00.000000000 Z
13
+ date: 2019-04-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -18,70 +18,70 @@ dependencies:
18
18
  requirements:
19
19
  - - "~>"
20
20
  - !ruby/object:Gem::Version
21
- version: '5.0'
21
+ version: '5.2'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - "~>"
27
27
  - !ruby/object:Gem::Version
28
- version: '5.0'
28
+ version: '5.2'
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: cancancan
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - "~>"
34
34
  - !ruby/object:Gem::Version
35
- version: '1.16'
35
+ version: '3'
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: '1.16'
42
+ version: '3'
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: ransack
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - "~>"
48
48
  - !ruby/object:Gem::Version
49
- version: '1.8'
49
+ version: '2.1'
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - "~>"
55
55
  - !ruby/object:Gem::Version
56
- version: '1.8'
56
+ version: '2.1'
57
57
  - !ruby/object:Gem::Dependency
58
58
  name: kaminari
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - "~>"
62
62
  - !ruby/object:Gem::Version
63
- version: '0.16'
63
+ version: '1.1'
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - "~>"
69
69
  - !ruby/object:Gem::Version
70
- version: '0.16'
70
+ version: '1.1'
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: simple_form
73
73
  requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
75
  - - "~>"
76
76
  - !ruby/object:Gem::Version
77
- version: '3.4'
77
+ version: '4.1'
78
78
  type: :runtime
79
79
  prerelease: false
80
80
  version_requirements: !ruby/object:Gem::Requirement
81
81
  requirements:
82
82
  - - "~>"
83
83
  - !ruby/object:Gem::Version
84
- version: '3.4'
84
+ version: '4.1'
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: nested_form
87
87
  requirement: !ruby/object:Gem::Requirement
@@ -116,14 +116,14 @@ dependencies:
116
116
  requirements:
117
117
  - - "~>"
118
118
  - !ruby/object:Gem::Version
119
- version: '1.1'
119
+ version: '1'
120
120
  type: :runtime
121
121
  prerelease: false
122
122
  version_requirements: !ruby/object:Gem::Requirement
123
123
  requirements:
124
124
  - - "~>"
125
125
  - !ruby/object:Gem::Version
126
- version: '1.1'
126
+ version: '1'
127
127
  - !ruby/object:Gem::Dependency
128
128
  name: sqlite3
129
129
  requirement: !ruby/object:Gem::Requirement
@@ -980,7 +980,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
980
980
  version: '0'
981
981
  requirements: []
982
982
  rubyforge_project:
983
- rubygems_version: 2.6.8
983
+ rubygems_version: 2.7.7
984
984
  signing_key:
985
985
  specification_version: 4
986
986
  summary: Easy CRUD generator for Rails Projects