Class: ActivityNotification::Generators::NotificationGenerator

Inherits:
ActiveRecord::Generators::Base
  • Object
show all
Defined in:
lib/generators/activity_notification/notification/notification_generator.rb

Overview

Notification generator to create customizable notification model from templates.

Examples:

Run notification generator to create customizable notification model

rails generate activity_notification:notification

Instance Method Summary collapse

Instance Method Details

#create_modelsObject

Create notification model in application directory



14
15
16
17
# File 'lib/generators/activity_notification/notification/notification_generator.rb', line 14

def create_models
  @model_name = name
  template 'notification.rb', "app/models/#{name.underscore}.rb"
end