Do you have any idea how to override Doorkeeper::Application
provided by the Doorkeeper gem.Let's say I want to add validation, callbacks and so on. Db table is named auth_applications
.
I created a model named application.rb containing the following but my before_create call is not triggered. What's the best approach?
module Doorkeeper
class Application < ActiveRecord::Base
include ApplicationMixin
require 'identicon'
before_create :generate_identicon
def generate_identicon
self.identicon = Identicon.data_url_for name, 128, [255, 255, 255]
end
end
end
As per this SO answer code should be declared as an initializer. However I'd like to have a classic model since there is a lot I want to add.