Sha256: 8b3d6208f1697ee31a3cbeae0960d4e651839ed67fd41f7b554fc7820be631fa

Contents?: true

Size: 558 Bytes

Versions: 5

Compression:

Stored size: 558 Bytes

Contents

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

      desc "Add :phone_number 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_number, :", :after => "devise :") if File.exists?(path)
      end

      hook_for :orm
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
devise_phone-0.0.14 lib/generators/devise_phone/devise_phone_generator.rb
devise_phone-0.0.13 lib/generators/devise_phone/devise_phone_generator.rb
devise_phone-0.0.12 lib/generators/devise_phone/devise_phone_generator.rb
devise_phone-0.0.11 lib/generators/devise_phone/devise_phone_generator.rb
devise_phone-0.0.1 lib/generators/devise_phone/devise_phone_generator.rb