Sha256: c3d96865d9ac468ba1e27b7d0e83fd608fe1e4767fd893eb334a54eccaf46efb

Contents?: true

Size: 425 Bytes

Versions: 3

Compression:

Stored size: 425 Bytes

Contents

require 'generators/cms/base'

module CMS
  module Generators

    class AdminGenerator < Base
      argument :email
      argument :password

      def create_admin
        User.create!({
          email: email,
          password: password,
          password_confirmation: password,
          role: 'admin'
        }, {
          without_protection: true,
          validate: false
        })
      end
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
honey-cms-0.5.1 lib/generators/cms/admin_generator.rb
honey-cms-0.4.8 lib/generators/cms/admin_generator.rb
honey-cms-0.4.7 lib/generators/cms/admin_generator.rb