lightek_vpm 0.4.0 → 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: ca8f5d9bb91ac1b79156705d94e12823e42574c54ed8d83af657e315daeaac68
4
- data.tar.gz: 7b0867d93eb334b955917f7b1b022773bbfced06ce2e4cea3e58168946235674
3
+ metadata.gz: f627ee188568a19bac737b2376624fba4659aeee16d15f99d71560d43c284cf8
4
+ data.tar.gz: f263418db79f5540875159ea210f9797681f07f990317cc043a887f1227aedb6
5
5
  SHA512:
6
- metadata.gz: 66385d0a603e123918a58ca20d58df18aa79079e3dd50cc38f550309002f72dc7f829f9b97a1925824f8b6f82e2dceb3e37d80dc0bfb424589ea3edfa80290c0
7
- data.tar.gz: fe8474a081c00176c48c9d54959672cde2ddf20dc10bf50987c8b9285ec2e3ece2c953aa70b13057b38e6288ba76d8d082acb9850fba94db872322e54f4c9cf9
6
+ metadata.gz: 86df1b8530e74f64e0f416aaaaa82e2c8720e67bedb4aff7e62a1c7f452b8acb6445793fea51af64a00e8f3d0e5fa6e5aaeead78d229374c4250fbcf0b7e4c03
7
+ data.tar.gz: 74e7079728533d82e48934d6ec72a9fc895e76f0be338db24239921e4261bb60aff9f7e75373f46cb5a641f10976e9598c6b158a644d9792fdafa1732a746835
@@ -5,6 +5,7 @@ module LightekVpm
5
5
  module Generators
6
6
  # Custom scaffolding generator
7
7
  class ControllerGenerator < Rails::Generators::NamedBase
8
+ source_root File.expand_path('../templates', __FILE__)
8
9
  include Rails::Generators::ResourceHelpers
9
10
  class_option :skip_show, type: :boolean, default: false, desc: 'Skip "show" action'
10
11
 
@@ -13,11 +13,14 @@ attr_accessor :options, :attributes
13
13
  end
14
14
  end
15
15
 
16
- def editable_attributes
17
- attributes ||= model_columns_for_attributes.map do |column|
18
- Rails::Generators::GeneratedAttribute.new(column.name.to_s, column.type.to_s)
16
+ def editable_attributes
17
+ model_columns = class_name.constantize.columns
18
+ model_columns.reject { |c| %w[id created_at updated_at].include?(c.name) }
19
+ end
20
+
21
+ def editable_attribute_names
22
+ editable_attributes.map(&:name).map { |attr| ":#{attr}" }.join(', ')
19
23
  end
20
- end
21
24
 
22
25
  def view_files
23
26
  actions = %w(index new edit _form)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LightekVpm
4
- VERSION = "0.4.0"
4
+ VERSION = "0.4.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lightek_vpm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marlon Henry
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-05-14 00:00:00.000000000 Z
11
+ date: 2024-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sassc-rails