who_delegated 0.3.3 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc6718c3ee654517bb021ed2df87ac6fa5f7ba284c112af0df0b25a9bd5b0b96
4
- data.tar.gz: 8e91b8ec68178000b20eee644a52f0a787dc958480196664a7fffb038ac81e22
3
+ metadata.gz: 4713c6ceaebc82b3ca665489592f1df85f557670f8bb41cb1e6349fbbbd0b71b
4
+ data.tar.gz: 1b8fecd7065321d99c78bea604935d18a47cd1618a3bd791f6bb1febe6677277
5
5
  SHA512:
6
- metadata.gz: 3576e2676d9cca7d7327458a5265e3dccca10cf4698f1bc91a9ef1e8832b700075862f8e2ea2576c8bc74dd48f20528b2a0482d66bb7eaed366500bfba643d95
7
- data.tar.gz: 8ca73e18607fb7db74bd80b64026a2bd3aa31cea8979b9d50c5aa0f5f7909507f09103d039347b6fd2fc57bc4ac1f0f3cd394b75001af13b24807fb9ab6a5012
6
+ metadata.gz: 57563f3ab4c9993650f089e56512c1b6bc3b9247d9435470503a53e92d762be46e36314466cddd9569380eb44a0f59701345e77243da2d55ca21e4fc515a74dd
7
+ data.tar.gz: 366963552e4a029ebf0d6e454962305e89dbd2da8d0e957b784fc6df6cc2d9f19ce317c99bbc39c71a27d9d44892fd0d24aed852aa72d97262f6fbfdb03f09c5
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # reopen ActiveRecord::Base to add delegated_method? method
4
- module ActiveRecord
5
- class Base # rubocop:todo Style/Documentation
4
+ module WhoDelegated
5
+ module ActiveRecordExtension
6
6
  def delegated_method?(method_name)
7
7
  respond_to?("delegated_#{method_name}?") && send("delegated_#{method_name}?")
8
8
  end
@@ -14,3 +14,5 @@ module ActiveRecord
14
14
  end
15
15
  end
16
16
  end
17
+
18
+ ActiveRecord::Base.send(:include, WhoDelegated::ActiveRecordExtension)
@@ -1,8 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "who_delegated/active_record_extension"
3
4
  require "module"
4
- require "activerecord/base"
5
-
6
5
  module WhoDelegated
7
6
  class Railtie < ::Rails::Railtie
8
7
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WhoDelegated
4
- VERSION = "0.3.3"
4
+ VERSION = "0.3.5"
5
5
  end
data/lib/who_delegated.rb CHANGED
@@ -1,11 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "active_record/base"
4
3
  require "active_support/core_ext/module/delegation"
5
- require "who_delegated/railtie"
4
+ require "active_record/base"
6
5
  require "zeitwerk"
7
6
  loader = Zeitwerk::Loader.for_gem(warn_on_extra_files: false)
8
7
  loader.setup
9
-
8
+ require "who_delegated/railtie"
10
9
  module WhoDelegated # rubocop:todo Style/Documentation
11
10
  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.3.3
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sampo Kuokkanen
@@ -36,9 +36,9 @@ files:
36
36
  - README.md
37
37
  - Rakefile
38
38
  - lib/module.rb
39
- - lib/tasks/activerecord/base.rb
40
39
  - lib/tasks/who_delegated_tasks.rake
41
40
  - lib/who_delegated.rb
41
+ - lib/who_delegated/active_record_extension.rb
42
42
  - lib/who_delegated/railtie.rb
43
43
  - lib/who_delegated/version.rb
44
44
  homepage: https://github.com/sampokuokkanen/who_delegated