class Key < ActiveRecord::Base
class << self
def generate (key)
Base64.encode64(key)
end
end
end
When calling Key.generate
from a controller it works as expected. However, when calling Key.generate
from a Rake::Task library I receive the error message:
uninitialized constant Base64
did you put require 'base64'
inside application.rb
after require 'rails/all'
?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With