lib/generators/scrivito/widget/widget_generator.rb in scrivito_sdk-0.30.0 vs lib/generators/scrivito/widget/widget_generator.rb in scrivito_sdk-0.40.0.rc1
- old
+ new
@@ -21,8 +21,20 @@
def generate_migration
migration_template 'migration.erb',
File.join(Scrivito::Configuration.migration_path, "create_#{file_name}_migration.rb")
end
+
+ def file_name
+ super.ends_with?('_widget') ? super : "#{super}_widget"
+ end
+
+ def class_name
+ super.ends_with?('Widget') ? super : "#{super}Widget"
+ end
+
+ def human_name
+ class_name.underscore.humanize
+ end
end
end
end