class Ahoy::Generators::Messages::MongoidGenerator
Public Instance Methods
Source
# File lib/generators/ahoy/messages/mongoid_generator.rb, line 13 def copy_templates case encryption when "lockbox" template "mongoid_lockbox.rb", "app/models/ahoy/message.rb", lockbox_method: lockbox_method else template "mongoid.rb", "app/models/ahoy/message.rb" end end
Source
# File lib/generators/ahoy/messages/mongoid_generator.rb, line 22 def encryption case options[:encryption] when "lockbox", "none" options[:encryption] else abort "Error: encryption must be lockbox or none" end end
Source
# File lib/generators/ahoy/messages/mongoid_generator.rb, line 31 def lockbox_method if defined?(Lockbox::VERSION) && Lockbox::VERSION.to_i < 1 "encrypts" else "has_encrypted" end end