Sha256: 084a0dade9e50a5acff07687d02ad20b859b90fe54ea37bd24b929d7e258c9b9
Contents?: true
Size: 745 Bytes
Versions: 50
Compression:
Stored size: 745 Bytes
Contents
require 'rails/generators' require 'rails/generators/migration' require 'rails/generators/active_record' module Kuhsaft module Translations class Add < Rails::Generators::Base include Rails::Generators::Migration source_root(File.join(Kuhsaft::Engine.root, '/lib/templates/kuhsaft/translations')) argument :locale, :type => :string def self.next_migration_number(dirname) ActiveRecord::Generators::Base.next_migration_number(dirname) end def get_locale locale.downcase.underscore end def create_locale_migration_file migration_template('add_translation.html.erb', Rails.root.join('db', 'migrate', "add_#{get_locale}_translation.rb")) end end end end
Version data entries
50 entries across 50 versions & 1 rubygems