templus_models 1.3.9 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1609a99d6ec102a92d66a1145c45e96d8aa0a6ea
|
4
|
+
data.tar.gz: b89f00e0818d3e1d8059e0d89f7a3cdd6ea13b20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 153364df16b09ec4e4587ae70f8f121d515ef439e0889afccb650a38b0f8e659950167276839f09ce3e7c1bf5f63d32f3789f132dea9185711469aafc2af9096
|
7
|
+
data.tar.gz: 615a5f1f132fd6d2cdb7034733df77f3293c8098f66b345da7df22ea080d2091476f86a3ae7cc9c84b929112557ce1eca8a4e33854c80a2d61ace4fc2f466c08
|
@@ -30,7 +30,7 @@ class CrudController < ApplicationController
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def new
|
33
|
-
authorize! :
|
33
|
+
authorize! :new, @model if respond_to?(:current_usuario)
|
34
34
|
if params[:render] == "modal"
|
35
35
|
if @model.reflect_on_association(params[:attribute].to_s).present?
|
36
36
|
@model = @model.reflect_on_association(params[:attribute].to_s).class_name.constantize
|
@@ -43,18 +43,18 @@ class CrudController < ApplicationController
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def edit
|
46
|
-
authorize! :edit, @model if respond_to?(:current_usuario)
|
47
46
|
@record = @model.find(params[:id])
|
47
|
+
authorize! :edit, @record if respond_to?(:current_usuario)
|
48
48
|
end
|
49
49
|
|
50
50
|
def show
|
51
|
-
authorize! :read, @model if respond_to?(:current_usuario)
|
52
51
|
@record = @model.find(params[:id])
|
52
|
+
authorize! :read, @record if respond_to?(:current_usuario)
|
53
53
|
end
|
54
54
|
|
55
55
|
def action
|
56
|
-
authorize! :create_or_update, @model if respond_to?(:current_usuario)
|
57
56
|
@record = @model.find(params[:id])
|
57
|
+
authorize! :create_or_update, @record if respond_to?(:current_usuario)
|
58
58
|
if @model.method_defined?(params[:acao])
|
59
59
|
if @record.send(params[:acao])
|
60
60
|
flash.now[:success] = "Ação #{params[:acao]} efetuada com sucesso."
|
@@ -70,13 +70,14 @@ class CrudController < ApplicationController
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def create
|
73
|
-
authorize! :create, @model if respond_to?(:current_usuario)
|
74
73
|
@saved = false
|
75
74
|
if params[:id]
|
76
75
|
@record = @model.find(params[:id])
|
76
|
+
authorize! :update, @record if respond_to?(:current_usuario)
|
77
77
|
@saved = @record.update(params_permitt)
|
78
78
|
else
|
79
79
|
@record = @model.new(params_permitt)
|
80
|
+
authorize! :create, @record if respond_to?(:current_usuario)
|
80
81
|
@saved = @record.save
|
81
82
|
end
|
82
83
|
|
@@ -98,8 +99,8 @@ class CrudController < ApplicationController
|
|
98
99
|
end
|
99
100
|
|
100
101
|
def destroy
|
101
|
-
authorize! :destroy, @model if respond_to?(:current_usuario)
|
102
102
|
@record = @model.find(params[:id])
|
103
|
+
authorize! :destroy, @record if respond_to?(:current_usuario)
|
103
104
|
if @record.destroy
|
104
105
|
respond_to do |format|
|
105
106
|
flash[:success] = "Cadastro removido com sucesso."
|
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.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrigo Sol
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-08-
|
12
|
+
date: 2015-08-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -960,7 +960,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
960
960
|
version: '0'
|
961
961
|
requirements: []
|
962
962
|
rubyforge_project:
|
963
|
-
rubygems_version: 2.
|
963
|
+
rubygems_version: 2.4.2
|
964
964
|
signing_key:
|
965
965
|
specification_version: 4
|
966
966
|
summary: Easy CRUD generator for Rails Projects
|