vue_crud-generator 0.1.0 → 0.1.1

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: 91c1e659bf0a9f074d213b3d1b43d71a36aca203cd7197919b52b92c1517525d
4
- data.tar.gz: f2de1c452a0039ac649d04594ce76660d64076c99a4e85837d5c657061a0360d
3
+ metadata.gz: 72b24f52c568de5b1fc0fbd80b59b6ce1482146593b3484018c6c4a62030b8bd
4
+ data.tar.gz: bd62bab6ba90ffa3d1d090c10bbeaea0e71a9e8ae270c96ce7b70eeb115fdaca
5
5
  SHA512:
6
- metadata.gz: 5c2df4665592e2264239b7803a561151b45cf846eb0ae31c6f717665d47826b98acebc1b3eb5b0d667efdb31014aebe0eb5d893170bf19be402782cbe207401f
7
- data.tar.gz: 1dc92cb5b11d04fec6dbc4ff2d87548a3a03be893950ee180c29a837dbd1de2bd41998d6850c5a522105fa5d312bd744cdff992deaf2d1d6df76f57d3d96b829
6
+ metadata.gz: 71b1f115245c181b04d4ca61b3cb49a7c320f333b74dec87c2f5d56391ddfacd1158572aca21a0f53a14f18aea27c0c0e34c1432d2d597b0b959e50d3c2d5b91
7
+ data.tar.gz: 0bb037e2e4340ca2dfe99a350e687db8f76ef9f5ee759332ae1037c7f47009b75313e9e2fd02a5958511d46619404ceec6d87e403a4a81ea96d88ea02d8ffb9d
@@ -22,11 +22,10 @@
22
22
  <%= primary_key_name.capitalize %> {{editedItem.<%= primary_key_name %>}}
23
23
  </div>
24
24
  <%= attributes_names_without_id.map { |name| (<<-JS).strip }.join("\n#{' ' * 26}")
25
- <v-flex xs12 sm12 md12>
25
+ <v-flex xs12 sm12 md12>
26
26
  <v-text-field v-model="editedItem.#{name}" label="#{name.capitalize}" />
27
- </v-flex>
28
- JS
29
- %>
27
+ </v-flex>
28
+ JS%>
30
29
  </v-layout>
31
30
  </v-container>
32
31
  </v-card-text>
@@ -85,8 +84,8 @@
85
84
  },
86
85
 
87
86
  close() {
88
- this.resetToDefault();
89
87
  this.dialog = false;
88
+ this.resetToDefault();
90
89
  },
91
90
 
92
91
  errorHandler(error) {
@@ -164,9 +163,10 @@
164
163
  return {
165
164
  defaultItem: {
166
165
  // you can add default values for your attributes here
167
- <%= attributes_names_without_id.map {|name| "#{name}: null" }.join(",\n#{' ' * 10}") %>
166
+ <%= render_attributes_defaults(10) %>
168
167
  },
169
168
  editedItem: {
169
+ <%= render_attributes_defaults(10) %>
170
170
  },
171
171
  editedId: -1,
172
172
  errorSnackbar: false,
@@ -14,6 +14,10 @@ module VueJs
14
14
  attributes_without_id.map(&:name)
15
15
  end
16
16
 
17
+ def render_attributes_defaults(indentation)
18
+ attributes_names_without_id.map {|name| "#{name}: null" }.join(",\n#{' ' * indentation}")
19
+ end
20
+
17
21
  def attributes_without_id
18
22
  @attributes_without_id ||= attributes.reject {|attr| attr.type == :primary_key}
19
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vue_crud-generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Senya
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-02 00:00:00.000000000 Z
11
+ date: 2018-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails