common_core_js 0.3.7 → 0.4.2

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: 5bd570ce32ada5b0551a77526d1b25e82f9b10a4ce9199e9abc60c3256a0c824
4
- data.tar.gz: 39d7097d4e3daa434959ec9c72d93f83bee971d715f7ccde0fcb791332b8f490
3
+ metadata.gz: e57dda2081a4472872145ebd8cdd9fdf28be5014488ee5080224d15c51f6e14f
4
+ data.tar.gz: 18440eefe37cb6eae705870efc0c37fba1caefdb9e2fef30e72575238dafcfd8
5
5
  SHA512:
6
- metadata.gz: 344db104a6bcca04942313947217d71f786698f6656590b5f49f03974046a557e8de438c3ba9146c1f2041996926341942f84ef3ff2b947883386e6c7ab2e9c0
7
- data.tar.gz: 5c51d14d8d1055b3652ce5e2351582951a60b0d5cb78b1b91153cbf60aab5e141579f177c4de169dd5de3d9cc059c4795c6b45d3024c9d720dcd361ae37814b9
6
+ metadata.gz: cae68e3566b0546c0d03f9a4061a9a357c33f925fc87957525ac94fe0f62fb3882227f824f2031260b7e23a827140d3f13bf7341926ff96a169c175783b68fdb
7
+ data.tar.gz: 258050b8e32b576e2ec0ad8b60ce01809a59f9107897ab7f92e160a4ab1073f7212784180954437728c54a9a1cefde2834d9a5f6973f0644d084801f76da9abe
@@ -0,0 +1,2 @@
1
+ github: [jasonfb]
2
+ custom: ["https://jfb.teachable.com"]
@@ -0,0 +1,4 @@
1
+ # repo: your_github_handle/foobar
2
+ # filename: FUNDING.YML
3
+
4
+ github: [jasonfb]
data/LICENSE CHANGED
@@ -1,8 +1,11 @@
1
1
  Permission is hereby granted to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2
2
 
3
- Any users of this software agree to work to dismantle systemic racism, seek justice for black, brown, transgender people, women, and LTBQIAA+ representation and inclusion.
3
+ Any users of this software agree to work to
4
+ 1) dismantle systemic racism;
5
+ 2) seek justice for black, brown, transgender people, women, and
6
+ 3) work towards LGBTQIAA+ representation and inclusion.
4
7
 
5
- Organizations using this software agree to center the narratives of black, brown, and transgender people people.
8
+ Organizations using this software agree to center the narratives of black, brown, transgender, and non-advantaged people in the world.
6
9
 
7
10
  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
11
 
data/README.md CHANGED
@@ -8,25 +8,32 @@ Yes, it's opinionated. Yes, it's metaprogramming. A lot of metaprogramming. Ruby
8
8
  No, I would not use this to build an intricate app. Yes, it's a great tool for prototyping. Yes, I think prototyping is a lost art.
9
9
 
10
10
 
11
- = THE SALES PITCH:
11
+ ## THE SALES PITCH:
12
12
  * Build plug-and-play scaffolding mixing HAML with jQuery-based Javascript
13
13
  * Automatically Reads Your Models (make them before building your scaffolding!)
14
- * Excellent for CRUD, lists with pagination, searching, sorting.
14
+ * Excellent for CRUD, lists with pagination, searching, ~~sorting.~~
15
15
  * Wonderful for prototyping.
16
16
  * Plays nicely with Devise, Kaminari, Haml-Rails, Rspec.
17
- * Create specs autoamatically along with the controllers.
17
+ * Create specs automatically along with the controllers.
18
18
  * Nest your routes model-by-model for built-in poor man's authentication
19
19
  * Throw the scaffolding away when your app is ready to graduate to its next phase.
20
20
 
21
+ ## THE BLOG POST
21
22
 
22
- = HOW EASY?
23
+ It's really easy to get started by following along with this blog post that creates three simple tables (User, Event, and Format).
24
+
25
+ Feel free to build your own tables when you get to the sections for building the 'Event' scaffold:
26
+
27
+ https://blog.jasonfleetwoodboldt.com/common-core-js
28
+
29
+ ## HOW EASY?
23
30
 
24
31
 
25
32
  ```
26
33
  rails generate common_core:scaffold Thing
27
34
  ```
28
35
 
29
- = TO INSTALL
36
+ ## TO INSTALL
30
37
 
31
38
  - Add common_core_js to your Gemfile
32
39
 
@@ -43,7 +50,7 @@ rails generate common_core:scaffold Thing
43
50
 
44
51
  Note that the arguments are not preceeded by dashes and are followed by equal sign and the input you are giving.
45
52
 
46
- Flags take two dashes (--) and do not take any value.
53
+ Flags take two dashes (--) and do not take any value. Always pass options first, followed by the flags (or else your options won't work!)
47
54
 
48
55
  ### First Argument
49
56
 
@@ -51,7 +58,7 @@ TitleCase class name of the thing you want to build a scaffoling for.
51
58
 
52
59
  ### `namespace=`
53
60
 
54
- pass `namespace=` as a flag to denote a namespace to apply to the Rails path helpers
61
+ pass `namespace=` as an option to denote a namespace to apply to the Rails path helpers
55
62
 
56
63
 
57
64
  `rails generate common_core:scaffold Thing namespace=dashboard`
@@ -75,7 +82,7 @@ end
75
82
 
76
83
  ### `nest=`
77
84
 
78
- pass `nest=` as a flag to denote a nested resources
85
+ pass `nest=` to denote a nested resources
79
86
 
80
87
 
81
88
  `rails generate common_core:scaffold Line nest=invoice`
@@ -132,7 +139,7 @@ When you display anything built with the scaffolding, we assume the `current_use
132
139
 
133
140
  If you use Devise, you probably already have a `current_user` method available in your controllers. If you don't use Devise, you can implement it in your ApplicationController.
134
141
 
135
- If you use a different object other than "User" for authentication, override using the `auth` flag.
142
+ If you use a different object other than "User" for authentication, override using the `auth` option.
136
143
 
137
144
  `rails generate common_core:scaffold Thing auth=current_account`
138
145
 
@@ -202,7 +209,7 @@ You don't need this if the pluralized version is just + "s" of the singular vers
202
209
 
203
210
  Use this flag to create controllers with no root authentication. You can still use an auth_identifier, which can be useful for a meta-leval authentication to the controoler.
204
211
 
205
- For example, FOR ADMIN CONTROLLERS ONLY, supply a auth_identifier and use --god flag
212
+ For example, FOR ADMIN CONTROLLERS ONLY, supply a auth_identifier and use `--god` flag
206
213
 
207
214
  In God mode, the objects are loaded directly from the base class (these controllers have full access)
208
215
  ```
@@ -286,3 +293,10 @@ environment.plugins.prepend('Provide',
286
293
  module.exports = environment
287
294
 
288
295
  ```
296
+
297
+
298
+ # ACKNOWLEDGEMENTS
299
+
300
+ ### "POOR MAN"
301
+
302
+ I hope one day I will leave this Earth a poor man (like my code) owning only the most simple structure for the simple form of my existence. Thanks for having educated me in this wisdom goes to my former mentor [@trak3r](https://github.com/trak3r)!
@@ -7,7 +7,6 @@ module CommonCoreHelper
7
7
 
8
8
 
9
9
  def datetime_field_localized(form_object, field_name, value, label, timezone = nil )
10
-
11
10
  res = form_object.label(label,
12
11
  field_name,
13
12
  class: 'small form-text text-muted')
@@ -22,6 +21,7 @@ module CommonCoreHelper
22
21
 
23
22
 
24
23
  def date_field_localized(form_object, field_name, value, label, timezone = nil )
24
+
25
25
  res = form_object.label(label,
26
26
  field_name,
27
27
  class: 'small form-text text-muted')
@@ -51,7 +51,7 @@ module CommonCoreHelper
51
51
  controller.current_timezone
52
52
  elsif defined?(current_user)
53
53
  if current_user.try(:timezone)
54
- Time.now.in_time_zone(current_user.timezone).strftime("%z").to_i/100
54
+ Time.now.in_time_zone(current_user.timezone.to_i).strftime("%z").to_i/100
55
55
  else
56
56
  Time.now.strftime("%z").to_i/100
57
57
  end
@@ -62,7 +62,6 @@ module CommonCoreHelper
62
62
 
63
63
 
64
64
  def date_to_current_timezone(date, timezone = nil)
65
-
66
65
  # if the timezone is nil, use the server date'
67
66
  if timezone.nil?
68
67
  timezone = Time.now.strftime("%z").to_i/100
@@ -8,12 +8,15 @@ Gem::Specification.new do |spec|
8
8
  spec.name = "common_core_js"
9
9
  spec.version = CommonCoreJs::VERSION
10
10
  spec.license = 'MIT'
11
- spec.date = '2020-06-28'
11
+ spec.date = '2020-10-29'
12
12
  spec.summary = "A gem build scaffolding."
13
13
  spec.description = "Simple, plug & play Rails scaffolding with really simple Javascript"
14
14
  spec.authors = ["Jason Fleetwood-Boldt"]
15
15
  spec.email = 'jason.fb@datatravels.com'
16
16
 
17
+ spec.homepage = 'https://blog.jasonfleetwoodboldt.com/common-core-js/'
18
+ spec.metadata = { "source_code_uri" => "https://github.com/jasonfb/common_core_js",
19
+ "course_material_uri" => "https://jfb.teachable.com/p/jason-s-open-source-work/"}
17
20
 
18
21
 
19
22
 
@@ -1,3 +1,3 @@
1
1
  module CommonCoreJs
2
- VERSION = '0.3.7'
2
+ VERSION = '0.4.2'
3
3
  end
@@ -68,6 +68,7 @@ module CommonCore
68
68
 
69
69
  args[1..-1].each do |a|
70
70
  var_name, var_value = a.split("=")
71
+ puts var_name
71
72
  case (var_name)
72
73
 
73
74
  when "plural"
@@ -83,21 +84,10 @@ module CommonCore
83
84
  end
84
85
  end
85
86
 
86
-
87
-
88
87
  auth_assoc = @auth.gsub("current_","")
89
- auth_assoc_field = auth_assoc + "_id"
90
-
91
-
92
88
 
93
- exclude_fields = [auth_assoc_field.to_sym, :id, :created_at, :updated_at, :encrypted_password, :reset_password_token,
94
- :reset_password_sent_at, :remember_created_at]
95
- begin
96
- @columns = object.columns.map(&:name).map(&:to_sym).reject{|field| exclude_fields.include?(field) }
97
- rescue StandardError => e
98
- puts "Ooops... it looks like is an object for #{class_name}. Please create the database table with fields first. "
99
- exit
100
- end
89
+ @no_delete = false
90
+ @no_create = false
101
91
 
102
92
  flags = meta_args[1]
103
93
  flags.each do |f|
@@ -110,6 +100,10 @@ module CommonCore
110
100
  @specs_only = true
111
101
  when "--no-specs"
112
102
  @no_specs = true
103
+ when "--no-delete"
104
+ @no_delete = true
105
+ when "--no-create"
106
+ @no_create = true
113
107
  end
114
108
  end
115
109
 
@@ -118,23 +112,74 @@ module CommonCore
118
112
  exit
119
113
  end
120
114
 
115
+
116
+ # only used for the before_action
121
117
  if @auth_identifier.nil? && !@auth.nil?
122
118
  @auth_identifier = @auth.gsub("current_", "")
123
119
  end
124
120
 
125
-
126
- if auth_identifier == @singular
121
+ # when in self auth, the object is the same as the authenticated object
122
+ if @auth && auth_identifier == @singular
127
123
  @self_auth = true
128
124
  end
129
125
 
130
126
  if !@nest.nil?
131
127
  @nested_args = @nest.split("/")
132
-
133
128
  @nested_args_plural = {}
134
129
  @nested_args.each do |a|
135
130
  @nested_args_plural[a] = a + "s"
136
131
  end
137
132
  end
133
+
134
+ # the @object_owner will always be object that will 'own' the object
135
+ # for new and create
136
+
137
+ if @auth && ! @self_auth && @nested_args.none?
138
+ @object_owner_sym = @auth.gsub("current_", "").to_sym
139
+ @object_owner_eval = @auth
140
+ else
141
+
142
+ if @nested_args.any?
143
+ @object_owner_sym = @nested_args.last.to_sym
144
+ @object_owner_eval = "@#{@nested_args.last}"
145
+ else
146
+ @object_owner_sym = ""
147
+ @object_owner_eval = ""
148
+ end
149
+ end
150
+
151
+
152
+
153
+ # create the columns
154
+ if !@object_owner_sym.empty?
155
+ auth_assoc_field = auth_assoc + "_id"
156
+ assoc = eval("#{singular_class}.reflect_on_association(:#{@object_owner_sym})")
157
+ if assoc
158
+ ownership_field = assoc.name.to_s + "_id"
159
+ else
160
+ puts "Ooops... it looks like is no association for #{@object_owner_sym} on #{singular_class} "
161
+ exit
162
+ end
163
+ end
164
+
165
+
166
+ exclude_fields = [ :id, :created_at, :updated_at, :encrypted_password, :reset_password_token,
167
+ :reset_password_sent_at, :remember_created_at, :confirmation_token, :confirmed_at,
168
+ :confirmation_sent_at, :unconfirmed_email]
169
+
170
+ exclude_fields << auth_assoc_field.to_sym if !auth_assoc_field.nil?
171
+ exclude_fields << ownership_field.to_sym if !ownership_field.nil?
172
+
173
+
174
+ begin
175
+ @columns = object.columns.map(&:name).map(&:to_sym).reject{|field| exclude_fields.include?(field) }
176
+ rescue StandardError => e
177
+ puts "Ooops... it looks like is an object for #{class_name}. Please create the database table with fields first. "
178
+ exit
179
+ end
180
+
181
+
182
+
138
183
  end
139
184
 
140
185
  def formats
@@ -150,7 +195,7 @@ module CommonCore
150
195
 
151
196
  unless @specs_only
152
197
  template "controller.rb", File.join("app/controllers#{namespace_with_dash}", "#{plural}_controller.rb")
153
- if @namespace
198
+ if @namespace && defined?(controller_descends_from) == nil
154
199
  template "base_controller.rb", File.join("app/controllers#{namespace_with_dash}", "base_controller.rb")
155
200
  end
156
201
  end
@@ -235,6 +280,14 @@ module CommonCore
235
280
  end
236
281
 
237
282
 
283
+ def path_helper_full
284
+ "#{@namespace+"_" if @namespace}#{(@nested_args.join("_") + "_" if @nested_args.any?)}#{singular}_path"
285
+ end
286
+
287
+ def path_helper_args
288
+ [(@nested_args if @nested_args.any? || []).collect{|a| "@#{a}"} , singular].join(",")
289
+ end
290
+
238
291
  def path_helper_singular
239
292
  "#{@namespace+"_" if @namespace}#{(@nested_args.join("_") + "_" if @nested_args.any?)}#{singular}_path"
240
293
  end
@@ -264,7 +317,7 @@ module CommonCore
264
317
  end
265
318
 
266
319
  def nested_arity_for_path
267
- @nested_args.join(", ") #metaprgramming into arity for the Rails path helper
320
+ [@nested_args[0..-1].collect{|a| "@#{a}"}].join(", ") #metaprgramming into arity for the Rails path helper
268
321
  end
269
322
 
270
323
  def object_scope
@@ -299,8 +352,12 @@ module CommonCore
299
352
  end
300
353
 
301
354
  def all_objects_variable
355
+
302
356
  # needs the authenticated root user
303
- "#{@auth}.#{ @nested_args.map{|a| "#{@nested_args_plural[a]}.find(@#{a})"}.join('.') + "." if @nested_args.any?}#{plural}"
357
+ # "#{@auth}.#{ @nested_args.map{|a| "#{@nested_args_plural[a]}.find(@#{a})"}.join('.') + "." if @nested_args.any?}#{plural}"
358
+
359
+ all_objects_root + ".page(params[:page])"
360
+
304
361
  end
305
362
 
306
363
  def auth_object
@@ -358,15 +415,6 @@ module CommonCore
358
415
  :erb
359
416
  end
360
417
 
361
-
362
- def create_merge_params
363
- if @auth && ! @self_auth
364
- "#{@auth_identifier}: #{@auth}"
365
- else
366
- ""
367
- end
368
- end
369
-
370
418
  def model_has_strings?
371
419
  false
372
420
  end
@@ -397,6 +445,7 @@ module CommonCore
397
445
  puts "*** Oops. on the #{singular_class} object, there doesn't seem to be an association called '#{assoc_name}'"
398
446
  exit
399
447
  end
448
+ assoc_class_name = eval("#{singular_class}.reflect_on_association(:#{assoc_name})").class_name
400
449
 
401
450
  if assoc.active_record.column_names.include?("name")
402
451
  display_column = "name"
@@ -412,9 +461,10 @@ module CommonCore
412
461
  puts "Can't find a display_column on {singular_class} object"
413
462
  end
414
463
 
464
+
415
465
  ".row
416
466
  %div{class: \"form-group col-md-4 \#{'alert-danger' if #{singular}.errors.details.keys.include?(:#{assoc_name.to_s})}\"}
417
- = f.collection_select(:#{col.to_s}, #{assoc_name.titleize}.all, :id, :#{display_column}, {prompt: true, selected: @#{singular}.#{col.to_s} }, class: 'form-control')
467
+ = f.collection_select(:#{col.to_s}, #{assoc_class_name}.all, :id, :#{display_column}, {prompt: true, selected: @#{singular}.#{col.to_s} }, class: 'form-control')
418
468
  %label.small.form-text.text-muted
419
469
  #{col.to_s.humanize}"
420
470
 
@@ -444,16 +494,27 @@ module CommonCore
444
494
  when :datetime
445
495
  ".row
446
496
  %div{class: \"form-group col-md-4 \#{'alert-danger' if #{singular}.errors.details.keys.include?(:#{col.to_s})}\"}
447
- = datetime_field_localized(f, :#{col.to_s}, @#{singular}.#{col.to_s}, '#{col.to_s.humanize}', #{@auth ? @auth+'.timezone' : 'nil'})"
497
+ = datetime_field_localized(f, :#{col.to_s}, #{singular}.#{col.to_s}, '#{col.to_s.humanize}', #{@auth ? @auth+'.timezone' : 'nil'})"
448
498
  when :date
449
499
  ".row
450
500
  %div{class: \"form-group col-md-4 \#{'alert-danger' if #{singular}.errors.details.keys.include?(:#{col.to_s})}\"}
451
- = date_field_localized(f, :#{col.to_s}, @#{singular}.#{col.to_s}, '#{col.to_s.humanize}', #{@auth ? @auth+'.timezone' : 'nil'})"
501
+ = date_field_localized(f, :#{col.to_s}, #{singular}.#{col.to_s}, '#{col.to_s.humanize}', #{@auth ? @auth+'.timezone' : 'nil'})"
452
502
  when :time
453
503
  ".row
454
504
  %div{class: \"form-group col-md-4 \#{'alert-danger' if #{singular}.errors.details.keys.include?(:#{col.to_s})}\"}
455
- = time_field_localized(f, :#{col.to_s}, @#{singular}.#{col.to_s}, '#{col.to_s.humanize}', #{@auth ? @auth+'.timezone' : 'nil'})"
505
+ = time_field_localized(f, :#{col.to_s}, #{singular}.#{col.to_s}, '#{col.to_s.humanize}', #{@auth ? @auth+'.timezone' : 'nil'})"
506
+ when :boolean
507
+ ".row
508
+ %div{class: \"form-group col-md-4 \#{'alert-danger' if #{singular}.errors.details.keys.include?(:#{col.to_s})}\"}
509
+ %span
510
+ #{col.to_s.humanize}
511
+ = f.radio_button(:#{col.to_s}, '0', checked: #{singular}.#{col.to_s} ? '' : 'checked')
512
+ = f.label(:#{col.to_s}, value: 'No', for: '#{singular}_#{col.to_s}_0')
513
+
514
+ = f.radio_button(:#{col.to_s}, '1', checked: #{singular}.#{col.to_s} ? 'checked' : '')
515
+ = f.label(:#{col.to_s}, value: 'Yes', for: '#{singular}_#{col.to_s}_1')
456
516
 
517
+ "
457
518
  end
458
519
 
459
520
  }.join("\n")
@@ -499,7 +560,7 @@ module CommonCore
499
560
  end
500
561
 
501
562
  " %td
502
- = #{singular}.#{assoc.name.to_s}.#{display_column}"
563
+ = #{singular}.#{assoc.name.to_s}.try(:#{display_column}) || '<span class=\"content alert-danger\">MISSING</span>'.html_safe"
503
564
 
504
565
  else
505
566
  " %td
@@ -536,7 +597,16 @@ module CommonCore
536
597
  %span.alert-danger
537
598
  MISSING
538
599
  "
539
-
600
+ when :boolean
601
+ " %td
602
+ - if #{singular}.#{col}.nil?
603
+ %span.alert-danger
604
+ MISSING
605
+ - elsif #{singular}.#{col}
606
+ YES
607
+ - else
608
+ NO
609
+ "
540
610
  end
541
611
  }.join("\n")
542
612
  return res
@@ -554,12 +624,12 @@ module CommonCore
554
624
 
555
625
  def destroy_action
556
626
  return false if @self_auth
557
- return true
627
+ return !@no_delete
558
628
  end
559
629
 
560
630
  def create_action
561
631
  return false if @self_auth
562
- return true
632
+ return !@no_create
563
633
  end
564
634
 
565
635
 
@@ -1,7 +1,7 @@
1
1
  <%= all_line_fields %>
2
2
  %td
3
3
  <% if destroy_action %>
4
- = link_to "Delete <i class='fa fa-1x fa-remove'></i>".html_safe, <%= path_helper_singular %>(<%= singular %>), remote: true ,method: :delete, disable_with: "Loading...", class: "delete-<%= singular %>-button btn btn-primary "
4
+ = link_to "Delete <i class='fa fa-1x fa-remove'></i>".html_safe, <%= path_helper_full %>(<%= path_helper_args %>), remote: true, method: :delete, data: {confirm: 'Are you sure?'}, disable_with: "Loading...", class: "delete-<%= singular %>-button btn btn-primary "
5
5
  <% end %>
6
6
  &nbsp;
7
- = link_to "Edit <i class='fa fa-1x fa-list-alt'></i>".html_safe, edit_<%= path_helper_singular %>(<%= singular %>), remote: true , disable_with: "Loading...", class: "edit-<%= singular %>-button btn btn-primary "
7
+ = link_to "Edit <i class='fa fa-1x fa-list-alt'></i>".html_safe, edit_<%= path_helper_full %>(<%= path_helper_args %>), remote: true , disable_with: "Loading...", class: "edit-<%= singular %>-button btn btn-primary "
@@ -1,5 +1,5 @@
1
1
  class <%= controller_class_name %> < <%= controller_descends_from %>
2
- <% unless @auth_identifier.nil? %>
2
+ <% unless @auth_identifier == '' %>
3
3
  before_action :authenticate_<%= auth_identifier %>!
4
4
 
5
5
  <% end %>
@@ -43,14 +43,14 @@ class <%= controller_class_name %> < <%= controller_descends_from %>
43
43
  end
44
44
 
45
45
  <% if create_action %> def new
46
- @<%= singular_name %> = <%= class_name %>.new(<%= create_merge_params %>)
46
+ @<%= singular_name %> = <%= class_name %>.new(<%= @object_owner_sym %>: <%= @object_owner_eval %>)
47
47
  respond_to do |format|
48
48
  format.js
49
49
  end
50
50
  end
51
51
 
52
52
  def create
53
- modified_params = modify_date_inputs_on_params(<%=singular_name %>_params.dup<% if !create_merge_params.empty? %>.merge!(<%= create_merge_params %>)<%end%> , <%= @auth ? @auth : "nil" %>)
53
+ modified_params = modify_date_inputs_on_params(<%=singular_name %>_params.dup<% if !@object_owner_sym.empty? %>.merge!(<%= @object_owner_sym %>: <%= @object_owner_eval %> )<% end %>, <%= @auth %>)
54
54
  @<%=singular_name %> = <%=class_name %>.create(modified_params)
55
55
  respond_to do |format|
56
56
  if @<%= singular_name %>.save
@@ -75,7 +75,7 @@ class <%= controller_class_name %> < <%= controller_descends_from %>
75
75
 
76
76
  def update
77
77
  respond_to do |format|
78
- if !@<%=singular_name %>.update(modify_date_inputs_on_params(<%= singular %>_params, <%= @auth ? @auth : "nil" %> ))
78
+ if !@<%=singular_name %>.update(modify_date_inputs_on_params(<%= singular %>_params, <%= @auth %> ))
79
79
  flash[:alert] = "<%=singular_name.titlecase %> could not be saved"
80
80
  end
81
81
  format.js {}
@@ -10,7 +10,7 @@ describe <%= controller_class_name %> do
10
10
  before(:each) do
11
11
  @request.env["devise.mapping"] = Devise.mappings[:account]
12
12
 
13
- sign_in <%= @auth %>, scope: :<%= @auth_identifier %>
13
+ sign_in <%= @auth %>, scope: :<%= @auth %>
14
14
  end
15
15
 
16
16
  describe "index" do
@@ -1 +1 @@
1
- <%%= render partial: 'common/common_create', locals: {object: @<%= singular %>, singular: "<%= singular %>", plural: "<%= plural %>"} %>
1
+ <%%= render partial: 'common/common_create', locals: {object: @<%= singular %>, singular: "<%= singular %>", plural: "<%= plural %>"<%= ", " + nested_assignments if nested_assignments %>} %>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: common_core_js
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Fleetwood-Boldt
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-28 00:00:00.000000000 Z
11
+ date: 2020-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -129,8 +129,10 @@ extensions: []
129
129
  extra_rdoc_files: []
130
130
  files:
131
131
  - ".generators"
132
+ - ".github/FUNDING.yml"
132
133
  - ".gitignore"
133
134
  - ".rakeTasks"
135
+ - FUNDING.yml
134
136
  - Gemfile
135
137
  - Gemfile.lock
136
138
  - LICENSE
@@ -228,8 +230,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
228
230
  - !ruby/object:Gem::Version
229
231
  version: '0'
230
232
  requirements: []
231
- rubygems_version: 3.0.3
232
- signing_key:
233
+ rubygems_version: 3.0.8
234
+ signing_key:
233
235
  specification_version: 4
234
236
  summary: A gem build scaffolding.
235
237
  test_files: []