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 con开发者_运维问答stant Base64
did you put require 'base64'
inside application.rb
after require 'rails/all'
?
精彩评论