Sha256: 4a391c78a073d56e768555b6c71a794bf9aa5c8687499095a23751d0a10af4ff
Contents?: true
Size: 906 Bytes
Versions: 19
Compression:
Stored size: 906 Bytes
Contents
module DeviseAuthy module Generators class DeviseAuthyGenerator < Rails::Generators::NamedBase namespace "devise_authy" desc "Add :authy_authenticatable directive in the given model, plus accessors. Also generate migration for ActiveRecord" def inject_devise_authy_content path = File.join("app","models","#{file_path}.rb") if File.exists?(path) && !File.read(path).include?("authy_authenticatable") inject_into_file(path, "authy_authenticatable, :", :after => "devise :") end if File.exists?(path) && !File.read(path).include?(":authy_id") inject_into_file(path, ":authy_id, :last_sign_in_with_authy, ", :after => "attr_accessible ") end end hook_for :orm end end end
Version data entries
19 entries across 19 versions & 1 rubygems