db_memoize 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 542f66f353af4205b3032b105e573b3eff743f9f
4
- data.tar.gz: 354532e3ecb878b26a2d2a292a77cb98b81019b9
3
+ metadata.gz: 4e6c10e2d8dffe1ff21a88e3f1349df1402a4df5
4
+ data.tar.gz: ee681aef3dc8e05bd34877dc1ec9717486f8000d
5
5
  SHA512:
6
- metadata.gz: 24aa305e6dfba23e2d7a4a8afa806295d74c4e410ba65e57630bde988564272859df0a530e3e831146591a43ca8ff32c80e853cd0cb3c9c48ed8146d0536d502
7
- data.tar.gz: 46a725d1f3b0bbd703979c718a89a44ee7cf79c2fd73b281585ec5e45b07d59f103469dd3f3c0c86909ad97b840fd6d1a3bd4f45fcde2c06fd0672561557bf76
6
+ metadata.gz: 27051ef728eeeeb41e3e5b7927fd1abaa464f7ac3f22e3ab5536a7788f86670f754f0c08feb3768aa4107c1d19f4ce2df38b156bbb3900651f1e29cb7ff19229
7
+ data.tar.gz: e4ea6308907c9627a61fca6981d0dbc78ac5c179f7425cd2235061a7ebf5a78e692143748cc3cde5eafdfe60147ae082dfd277b726efe0550eae08703bce4f0a
@@ -70,10 +70,18 @@ module DbMemoize
70
70
 
71
71
  module ClassMethods
72
72
  def db_memoize(method_name)
73
+ @db_memoized_methods ||= []
74
+ @db_memoized_methods.push(method_name.to_sym)
75
+
73
76
  create_alias_method(method_name)
74
77
  create_memoized_values_association
75
78
  end
76
79
 
80
+ def db_memoized_methods
81
+ methods = @db_memoized_methods || []
82
+ superclass.respond_to?(:db_memoized_methods) ? (superclass.db_memoized_methods + methods).uniq : methods
83
+ end
84
+
77
85
  def unmemoize(records_or_ids, method_name = :all)
78
86
  conditions = {
79
87
  entity_table_name: table_name,
@@ -1,3 +1,3 @@
1
1
  module DbMemoize
2
- VERSION = '0.1.4'.freeze
2
+ VERSION = '0.1.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: db_memoize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - johannes-kostas goetzinger