Sha256: e4c10e4353b484607a5260dd90c55cbecb717cec335592ce813911f33769393b

Contents?: true

Size: 508 Bytes

Versions: 5

Compression:

Stored size: 508 Bytes

Contents

require "rails/generators"

module Ahoy
  module Generators
    module Messages
      class MongoidGenerator < Rails::Generators::Base
        source_root File.join(__dir__, "templates")

        class_option :unencrypted, type: :boolean

        def copy_templates
          if options[:unencrypted]
            template "mongoid.rb", "app/models/ahoy/message.rb"
          else
            template "mongoid_encrypted.rb", "app/models/ahoy/message.rb"
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ahoy_email-2.1.0 lib/generators/ahoy/messages/mongoid_generator.rb
ahoy_email-2.0.3 lib/generators/ahoy/messages/mongoid_generator.rb
ahoy_email-2.0.2 lib/generators/ahoy/messages/mongoid_generator.rb
ahoy_email-2.0.1 lib/generators/ahoy/messages/mongoid_generator.rb
ahoy_email-2.0.0 lib/generators/ahoy/messages/mongoid_generator.rb