Sha256: 13468a3424a74cd7e5bffec8daac359b9f23998db61011b2b1b99b2913f47ae7

Contents?: true

Size: 544 Bytes

Versions: 24

Compression:

Stored size: 544 Bytes

Contents

module DevisePhone
  module Generators
    class DevisePhoneGenerator < Rails::Generators::NamedBase
      namespace "devise_phone"

      desc "Add :phone directive in the given model. Also generate migration for ActiveRecord"

      # def devise_generate_model
      #   invoke "devise", [name]
      # end

      def inject_devise_phone_content
        path = File.join("app", "models", "#{file_path}.rb")
        inject_into_file(path, "phone, :", :after => "devise :") if File.exists?(path)
      end

      hook_for :orm
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
devise_phone-0.0.162 lib/generators/devise_phone/devise_phone_generator.rb
devise_phone-0.0.161 lib/generators/devise_phone/devise_phone_generator.rb
devise_phone-0.0.16 lib/generators/devise_phone/devise_phone_generator.rb
devise_phone-0.0.15 lib/generators/devise_phone/devise_phone_generator.rb