who_delegated 0.3.4 → 0.3.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
  SHA256:
3
- metadata.gz: 24d4480ce5ad09bb027a1f95dc239a757e0bf664f814fd5c9a47fb61b87e3860
4
- data.tar.gz: a2c0e877e1a18b26029aa5563afe646e0b95d7ade629a6281f98146c0e16a54a
3
+ metadata.gz: 4713c6ceaebc82b3ca665489592f1df85f557670f8bb41cb1e6349fbbbd0b71b
4
+ data.tar.gz: 1b8fecd7065321d99c78bea604935d18a47cd1618a3bd791f6bb1febe6677277
5
5
  SHA512:
6
- metadata.gz: 1349be0567dfc56c280c3fc213e7e28cfd0d8d5b5e569b03cdeb74935ea7a37343b170f08589c9270084974226bee8166162a414ffa58c53555786c4187df5c6
7
- data.tar.gz: 7bd953ff823ceecaa53934da623b05d2552b228edf8af761370adc5441ce82b2f773f6df6b814b4a1c13b23050e49608aa8b29ad8625959869e64388c3106252
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.4"
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.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sampo Kuokkanen
@@ -35,10 +35,10 @@ files:
35
35
  - MIT-LICENSE
36
36
  - README.md
37
37
  - Rakefile
38
- - lib/activerecord/base.rb
39
38
  - lib/module.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