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