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.1.26 lib/generators/devise_phone/devise_phone_generator.rb
devise_phone-0.1.25 lib/generators/devise_phone/devise_phone_generator.rb
devise_phone-0.1.24 lib/generators/devise_phone/devise_phone_generator.rb
devise_phone-0.1.23 lib/generators/devise_phone/devise_phone_generator.rb
devise_phone-0.1.22 lib/generators/devise_phone/devise_phone_generator.rb
devise_phone-0.1.21 lib/generators/devise_phone/devise_phone_generator.rb
devise_phone-0.1.2 lib/generators/devise_phone/devise_phone_generator.rb
devise_phone-0.1.1 lib/generators/devise_phone/devise_phone_generator.rb
devise_phone-0.1.0 lib/generators/devise_phone/devise_phone_generator.rb
devise_phone-0.0.17 lib/generators/devise_phone/devise_phone_generator.rb
devise_phone-0.0.1667 lib/generators/devise_phone/devise_phone_generator.rb
devise_phone-0.0.1666 lib/generators/devise_phone/devise_phone_generator.rb
devise_phone-0.0.1665 lib/generators/devise_phone/devise_phone_generator.rb
devise_phone-0.0.1664 lib/generators/devise_phone/devise_phone_generator.rb
devise_phone-0.0.1663 lib/generators/devise_phone/devise_phone_generator.rb
devise_phone-0.0.1662 lib/generators/devise_phone/devise_phone_generator.rb
devise_phone-0.0.1661 lib/generators/devise_phone/devise_phone_generator.rb
devise_phone-0.0.166 lib/generators/devise_phone/devise_phone_generator.rb
devise_phone-0.0.165 lib/generators/devise_phone/devise_phone_generator.rb
devise_phone-0.0.164 lib/generators/devise_phone/devise_phone_generator.rb