Class: VueJs::VuetifyCrudGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- VueJs::VuetifyCrudGenerator
- Defined in:
- lib/generators/vue_js/vuetify_crud/vuetify_crud_generator.rb
Instance Method Summary collapse
- #attributes_names_without_id ⇒ Object
- #attributes_without_id ⇒ Object
- #create_component_file ⇒ Object
- #primary_key_name ⇒ Object
Instance Method Details
#attributes_names_without_id ⇒ Object
13 14 15 |
# File 'lib/generators/vue_js/vuetify_crud/vuetify_crud_generator.rb', line 13 def attributes_names_without_id attributes_without_id.map(&:name) end |
#attributes_without_id ⇒ Object
17 18 19 |
# File 'lib/generators/vue_js/vuetify_crud/vuetify_crud_generator.rb', line 17 def attributes_without_id @attributes_without_id ||= attributes.reject {|attr| attr.type == :primary_key} end |
#create_component_file ⇒ Object
9 10 11 |
# File 'lib/generators/vue_js/vuetify_crud/vuetify_crud_generator.rb', line 9 def create_component_file template "crud_component.vue.tt", "app/javascript/components/#{plural_name}_crud.vue" end |
#primary_key_name ⇒ Object
21 22 23 |
# File 'lib/generators/vue_js/vuetify_crud/vuetify_crud_generator.rb', line 21 def primary_key_name @primary_key_name ||= find_primary_key.name end |