lib/ronin/cached_file.rb in ronin-1.0.0.rc1 vs lib/ronin/cached_file.rb in ronin-1.0.0.rc2
- old
+ new
@@ -16,16 +16,17 @@
# You should have received a copy of the GNU General Public License
# along with Ronin. If not, see <http://www.gnu.org/licenses/>.
#
require 'ronin/support/inflector'
-require 'ronin/repository'
require 'ronin/model'
require 'contextify'
module Ronin
+ autoload :Repository, 'ronin/repository'
+
#
# The {CachedFile} model stores information in the {Database} about
# files that {Cacheable} Models were cached from. {CachedFile} also
# manages the {Cacheable} objects that were saved in the {Database}.
#
@@ -90,11 +91,11 @@
rescue NameError
return nil
end
# filter out non-Cacheable models
- return model if model.ancestors.include?(Cacheable)
+ return model if model < Cacheable
end
#
# The object from the Database that was cached from the file.
#
@@ -125,10 +126,10 @@
end
blocks.each do |name,block|
model = Contextify.contexts[name]
- if model.ancestors.include?(Cacheable)
+ if model < Cacheable
# create the fresh object
object = model.new()
begin
object.instance_eval(&block)