templus_models 1.5.4 → 1.5.5

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
  SHA1:
3
- metadata.gz: bc61933fb705746e9463954946882898c33afac9
4
- data.tar.gz: 19c0dbd5399c0d085afe81ba7b058950a3a725d0
3
+ metadata.gz: 645a6997bc5923f9f20dc3a97dba19a737e1c847
4
+ data.tar.gz: 13baccd965afa06ac28ee7b414fcd5456b5cd130
5
5
  SHA512:
6
- metadata.gz: 7c155d5ca0b93d4bd2ccf9eaaf751a56edb5c0b980f2e7a39d3a428ed0f087a029803caa7d5e4df56047e1215680bed93e79b1e5c66ca4520dcaf2dff96ad488
7
- data.tar.gz: ad5564b2e48fcf8b00dc9c447f03f18efe2781d8d5313cc34f7e94020832698cd6caa280a138b4d561c3df0d24567d75c24f9b3600a01706b5d2919c70c05f51
6
+ metadata.gz: 050db1a65973e7b67e9b6843de353c37a4079057c716f9bca19843e38b645c81b7b72eaef5e409351c750fb4fb86af9d2d38a0ac7e4e6c6b0dbd111cd6ef0902
7
+ data.tar.gz: 14aeba7451d36a7b316cfb764a9e85186b742aa7b5f810afdf9535da848304090e617b7a3d681bbb8b8e3b23080ee84aa86df6b2b7aefb98e563330d74f31306
@@ -34,9 +34,9 @@ class CrudController < ApplicationController
34
34
  end
35
35
  end
36
36
  if respond_to?(:current_usuario)
37
- @records = @q.result(distinct: true).accessible_by(current_ability, :read).page(params[:page]).per(@crud_helper.per_page)
37
+ @records = @q.result.accessible_by(current_ability, :read).page(params[:page]).per(@crud_helper.per_page)
38
38
  else
39
- @records = @q.result(distinct: true).page(params[:page]).per(@crud_helper.per_page)
39
+ @records = @q.result.page(params[:page]).per(@crud_helper.per_page)
40
40
  end
41
41
  @titulo = @model.name.pluralize
42
42
  render partial: 'records' if request.respond_to?(:wiselinks_partial?) && request.wiselinks_partial?
@@ -136,9 +136,9 @@ class CrudController < ApplicationController
136
136
  @q = @resource.search(params[:q])
137
137
  @q.sorts = 'updated_at desc' if @q.sorts.empty?
138
138
  if respond_to?(:current_usuario)
139
- results = @q.result(distinct: true).accessible_by(current_ability).page(params[:page])
139
+ results = @q.result.accessible_by(current_ability).page(params[:page])
140
140
  else
141
- results = @q.result(distinct: true).page(params[:page])
141
+ results = @q.result.page(params[:page])
142
142
  end
143
143
  instance_variable_set("@#{params[:var]}", results)
144
144
  if request.respond_to?(:wiselinks_partial?) && request.wiselinks_partial?
@@ -156,9 +156,9 @@ class CrudController < ApplicationController
156
156
  @q = @model.search(parametros)
157
157
  @q.sorts = 'updated_at desc' if @q.sorts.empty?
158
158
  if respond_to?(:current_usuario)
159
- results = @q.result(distinct: true).accessible_by(current_ability).page(params[:page])
159
+ results = @q.result.accessible_by(current_ability).page(params[:page])
160
160
  else
161
- results = @q.result(distinct: true).page(params[:page])
161
+ results = @q.result.page(params[:page])
162
162
  end
163
163
  method_label = params[:label]
164
164
  render json: results.map {|result| {id: result.id, label: result.send(method_label), value: result.send(method_label)} }
@@ -1,3 +1,3 @@
1
1
  module TemplusModels
2
- VERSION = "1.5.4"
2
+ VERSION = "1.5.5"
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: 1.5.4
4
+ version: 1.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Sol