Sha256: 1125d40777c58fe21da8d6c34a9a29a01b1c4eac729f20792d4ddf428cb67ae9

Contents?: true

Size: 704 Bytes

Versions: 10

Compression:

Stored size: 704 Bytes

Contents

class Wupee::NotificationTypeGenerator < Rails::Generators::NamedBase
  def add_notification_subject
    inject_into_file "config/locales/#{I18n.locale.to_s}.yml", after: /email_subjects:\n/ do
<<-CODE
      #{file_name}: "#{file_name}"
CODE
    end
  end

  def create_notification_json_template_file
    create_file "app/views/wupee/api/notifications/_#{file_name}.json.jbuilder", <<-FILE
json.subject "subject"
json.body "body"
json.url "url"
    FILE
  end

  def create_notification_html_template_file
    create_file "app/views/wupee/notifications/_#{file_name}.html.erb", <<-FILE
    FILE
  end

  def create_notification_type_object
    Wupee::NotificationType.create!(name: file_name)
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
wupee-2.0.0.beta2 lib/generators/wupee/notification_type/notification_type_generator.rb
wupee-2.0.0.beta1 lib/generators/wupee/notification_type/notification_type_generator.rb
wupee-1.1.4 lib/generators/wupee/notification_type/notification_type_generator.rb
wupee-1.1.3 lib/generators/wupee/notification_type/notification_type_generator.rb
wupee-1.1.2 lib/generators/wupee/notification_type/notification_type_generator.rb
wupee-1.0.4 lib/generators/wupee/notification_type/notification_type_generator.rb
wupee-1.0.3 lib/generators/wupee/notification_type/notification_type_generator.rb
wupee-1.0.2 lib/generators/wupee/notification_type/notification_type_generator.rb
wupee-1.0.1 lib/generators/wupee/notification_type/notification_type_generator.rb
wupee-1.0.0 lib/generators/wupee/notification_type/notification_type_generator.rb