memoize domains
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
class Artist < ActiveRecord::Base
|
||||
extend Memoist
|
||||
class RevertError < Exception ; end
|
||||
|
||||
before_create :initialize_creator
|
||||
@@ -52,6 +53,10 @@ class Artist < ActiveRecord::Base
|
||||
end
|
||||
end
|
||||
|
||||
included do
|
||||
memoize :domains
|
||||
end
|
||||
|
||||
def url_array
|
||||
urls.map(&:url)
|
||||
end
|
||||
@@ -250,6 +255,8 @@ class Artist < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def reload(options = nil)
|
||||
flush_cache
|
||||
|
||||
if instance_variable_defined?(:@notes)
|
||||
remove_instance_variable(:@notes)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user