lib/active_archive/methods.rb in active_archive-2.2.2 vs lib/active_archive/methods.rb in active_archive-2.3.0
- old
+ new
@@ -1,17 +1,17 @@
module ActiveArchive
module Methods
def archivable?
- columns.detect { |c| c.name == "archived_at" }
+ columns.lazy.detect { |c| c.name == 'archived_at'.freeze }
end
def archive_all(conditions=nil)
conditions ? where(conditions).destroy_all : destroy_all
end
def unarchive_all(conditions=nil)
- (conditions ? where(conditions) : all).to_a.each { |r| r.unarchive }
+ (conditions ? where(conditions) : all).to_a.lazy.each { |r| r.unarchive }
end
end
end
\ No newline at end of file