Displaying 1 result from an estimated 1 matches for "load_samples".
2014 Feb 19
0
Extending a module to models causes ArgumentError A copy of xx has been removed from module tree
...w can I extend a module to a model class and use an instance of a
custom class as a class instance variable for model such that when next
request comes, custom class could be found and older instances are
deleted?
I created a class Samples. I also created a module LoadSamples where
in a method say load_samples, I create a new Samples instance and
assign it to a class instance variable. I extend LoadSamples to
ActiveRecord::Base and called load_samples from model User.
class Samples
...
end
module LoadSamples
attr_accessor :samples
def load_samples
@samples ||= Samples.new
...
end
end
T...