who_delegated 0.1.0 → 0.2.0

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
  SHA256:
3
- metadata.gz: ff8900cab08a42676dba8802a3a9864c4ddfcca683836e82e7ef77bfaa5ddd9d
4
- data.tar.gz: 666641bf2f910165ffcdc16c35269110e612608e77b6ef029674ef56985a3e35
3
+ metadata.gz: cf163ab8caaa0c2f44dae80556d44f5dd33a3e68a456ede43d5bb3de41f4df6e
4
+ data.tar.gz: dcccb41c0ea2844e8d7b2aecb0419ee6577617a272782ddfc88af1d0c7769a68
5
5
  SHA512:
6
- metadata.gz: f3fed141d4e32b25ed23977388d76b71a77edc21d3b2e1bca1ddf09db447ca5a22a9ed8661540b99c87bd42ab79d2219fb75621a9cc04219463c782c7e7f56f1
7
- data.tar.gz: '08e48fff955609091bcbcfce147962218bc673fd7e4dcb451ce8b439bd6c9890f78e5a6f6feac8d62968c4b2efac0311d3e8f17a9a54f4158e4741a625be4d96'
6
+ metadata.gz: 6ce5f1dba2a434efca960aabd5c5601ac3b9afe5392975e6dada16643d783b97e7e858e8b0fd055466610a4f0b9250289f0fd370ced4c282d65e74f0f093c5ea
7
+ data.tar.gz: 777a522054610bf29008925d8ca8d09e7eafe78adf403b7ba4ffb1553604b0e85ff2eea488feccddd1427f04a2b05c0ba7226f1c54c9db916ef54ef358f421ad
@@ -6,5 +6,11 @@ module ActiveRecord
6
6
  def delegated_method?(method_name)
7
7
  respond_to?("delegated_#{method_name}?") && send("delegated_#{method_name}?")
8
8
  end
9
+
10
+ def delegated_target(method_name)
11
+ return unless delegated_method?(method_name)
12
+
13
+ send("delegated_#{method_name}?")
14
+ end
9
15
  end
10
16
  end
@@ -7,7 +7,7 @@ class Module
7
7
  if defined?(ActiveRecord::Base) && self < ActiveRecord::Base
8
8
  methods.each do |method|
9
9
  define_method("delegated_#{prefix}#{method}?") do
10
- true
10
+ to
11
11
  end
12
12
  end
13
13
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WhoDelegated
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: who_delegated
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sampo Kuokkanen