templus_models 1.2.8 → 1.3.0

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: 759ecb2091ecb46592842147c492c33579b3fed3
4
- data.tar.gz: 95f467af12abf3685f4ebdd3d52a3efec0a1ed24
3
+ metadata.gz: 75e5413045e53b19661f659bebb9b87f050a12dd
4
+ data.tar.gz: 91595263113973c97aca2ec486e76cda7d6d3be6
5
5
  SHA512:
6
- metadata.gz: d58cebd1912b024a6572d326cf895d7dd38ffda8f746258b534609dd6b7aa0f65029d8b2476c72a29d439e33429348bd04d8e6ece04ca10a36ad888ec12e01d7
7
- data.tar.gz: cf43149dbe763d0ddbb9da5d5d50b98a2ef9a17f2411ae1a93999c050537c1c671ed021ed2d4b10e8ee02ce332740248e9aa73e79097dc8d9cfba4aa7c20784b
6
+ metadata.gz: 0edadf0231626d5bfeeb3ce0c2eb45c4753d85c6fdd7f1915c9f7853f10eb6255ac9868fcc29d51a8b3ab049d5595744e0e4c845290c3cd6d40b32ce8b142c34
7
+ data.tar.gz: 6b28f98a08d8da8b056b2c0117e6632fec359a30c1d6387ce9c61dca601fff50a413c4764217c8abf74f74783e4f6fc781cd68a11694f9c480a40917c5cb2993
@@ -9,7 +9,7 @@ module MensagensHelper
9
9
  def flash_messages
10
10
  message, tipo = extrair_mensagem
11
11
  if message.present? && tipo.present?
12
- render "/crud/mensagens/avisos", tipo: tipo, mensagem: menssagem
12
+ render "/crud/mensagens/avisos", tipo: tipo, mensagem: message
13
13
  end
14
14
  end
15
15
 
@@ -30,10 +30,12 @@
30
30
  <% end %>
31
31
  <%@crud_helper.form_groups.each do |key, groups|%>
32
32
  <% modelo = @model.reflect_on_association(key.to_s).class_name.constantize %>
33
- <% if [:has_many,:has_and_belongs_to_many].include?(@model.reflect_on_association(key).macro) && @record.new_record? && !@record.send(key).present? %>
34
- <% @record.send(key).build %>
35
- <% elsif @record.new_record? && !@record.send(key).present?%>
33
+ <% if @record.present? && !@record.send(key).present? %>
34
+ <% if [:has_many,:has_and_belongs_to_many].include?(@model.reflect_on_association(key).macro) %>
35
+ <% @record.send(key).build %>
36
+ <% else %>
36
37
  <% @record.send("build_#{key}") %>
38
+ <% end %>
37
39
  <% end %>
38
40
  <%= f.simple_fields_for key do |g| %>
39
41
  <div class="col-sm-12">
@@ -1,4 +1,4 @@
1
1
  <div class='alert alert-<%= tipo %> alert-dismissable'>"
2
2
  <button aria-hidden='true' data-dismiss='alert' class='close' type='button'>×</button>"
3
- <%= message %>
3
+ <%= mensagem %>
4
4
  </div>
@@ -1,3 +1,3 @@
1
1
  module TemplusModels
2
- VERSION = "1.2.8"
2
+ VERSION = "1.3.0"
3
3
  end
@@ -1,7 +1,7 @@
1
1
  class Teste1 < ActiveRecord::Base
2
2
  belongs_to :teste
3
3
 
4
- accepts_nested_attributes_for :teste
4
+ accepts_nested_attributes_for :teste, allow_destroy: true
5
5
  def to_s
6
6
  descricao
7
7
  end
@@ -8,9 +8,11 @@ class Teste1Crud < RaroCrud
8
8
  campo_tabela :descricao, label: "Descrição"
9
9
  campo_tabela :teste, label: "Nome", sort_field: :teste_nome
10
10
 
11
+ campo_formulario :descricao, label: "Descrição"
11
12
  grupo_formulario :teste, [
12
13
  {campo: :nome, label: "Nome"}
13
14
  ]
15
+
14
16
  campo_visualizacao :descricao, label: "Descrição"
15
17
  campo_visualizacao :teste, label: "Teste"
16
18
 
Binary file
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.2.8
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Sol