From 296669ea6f785b8daa79282b071832be03627582 Mon Sep 17 00:00:00 2001 From: Washington Botelho Date: Thu, 8 Feb 2018 19:50:48 -0200 Subject: [PATCH] up: adds initializer template --- lib/generators/rating/install_generator.rb | 6 ++++++ .../rating/templates/config/initializers/rating.rb | 3 +++ 2 files changed, 9 insertions(+) create mode 100644 lib/generators/rating/templates/config/initializers/rating.rb diff --git a/lib/generators/rating/install_generator.rb b/lib/generators/rating/install_generator.rb index c810816..0dd8853 100644 --- a/lib/generators/rating/install_generator.rb +++ b/lib/generators/rating/install_generator.rb @@ -4,6 +4,12 @@ module Rating class InstallGenerator < Rails::Generators::Base source_root File.expand_path('../templates', __FILE__) + desc 'Creates Rating initializer' + + def copy_initializer + copy_file 'config/initializers/rating.rb', 'config/initializers/rating.rb' + end + desc 'Creates Rating migration' def create_migration diff --git a/lib/generators/rating/templates/config/initializers/rating.rb b/lib/generators/rating/templates/config/initializers/rating.rb new file mode 100644 index 0000000..fd789c5 --- /dev/null +++ b/lib/generators/rating/templates/config/initializers/rating.rb @@ -0,0 +1,3 @@ +# Rating.configure do |config| +# config.models rate: '::Rating::Rate', rating: '::Rating::Rating' +# end