Sunday, 18 August 2013

Is it possible to override a rails engine model association in a decorator?

Is it possible to override a rails engine model association in a decorator?

I'm using a rails engine which defines a class with the following relation:
module Blogit
class Post < ActiveRecord::Base
...
belongs_to :blogger, :polymorphic => true
...
end
I'm trying to override this association in a decorator file. Namely, I do
not want this association to exist if possible.
In my decorator file, i'm using a class_eval to extend the class definition.
Blogit::Post.class_eval do
...
end
but I can't seem to override or destroy this relation. Anyone know how to
do this?

No comments:

Post a Comment