immosquare-extensions 0.1.24 → 0.1.25

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: 3d4ded5cc647e8126d631f8ca563eef84565028fd6ce7a02b2c02cc7f8d6e5fa
4
- data.tar.gz: 1d6d1a14217c893831fc42d213bd501dc3e5395495ccf374c57ab548f6cfd7f2
3
+ metadata.gz: ba51ed41c3634406db205a26151c6cda8219a982126e4dae21042982c2084214
4
+ data.tar.gz: bdc036cfdcc9a66e18db188482d0d4a61ed49829e64ccccde39df5932f9bfd78
5
5
  SHA512:
6
- metadata.gz: 76e11581eeb74ed8b42f24f224b9784ba5421efd926061dcb5e5aa2e71aa0940a4caf4478624a07d63e76b06be1f7b7f53f586052c472b08eeaec0158d148c42
7
- data.tar.gz: 48b1920ad971819e4118cfa0d20dbd560cf1bad98394fa5ebb2277eb655ce9c8dcae8fe007b5065876a42b5dbb1616f32f196c1c886ec15d10a0ea7d0e2fb16a
6
+ metadata.gz: 2da7574722a68408c77651bbeaf8cc1489ba4973c4aa947a06ac107aa46992946cf53df46754ee3a03ad800b047f95862b83e230b909a052a0bad1f3933ae064
7
+ data.tar.gz: 69d36d4d563c8afddc27b0ba41dd4edc243b16693222970ff5c78f4f36b9c2ee41ced5a9751427e49be453d374da12a82745d78467b87f81c63a0b8286b80a87
@@ -0,0 +1,15 @@
1
+
2
+ module ImmosquareExtensions
3
+ module ApplicationRecord
4
+ ##============================================================##
5
+ ## On ajoute une méthode dig pour pouvoir accéder à des
6
+ ## attributs imbriqués sans avoir à vérifier si les objets
7
+ ## user.dig(:user_profile, :user_card_type, :slug)
8
+ ##============================================================##
9
+ def dig(*keys)
10
+ keys.reduce(self) do |obj, key|
11
+ obj.respond_to?(key) ? obj.send(key) : nil
12
+ end
13
+ end
14
+ end
15
+ end
@@ -9,5 +9,12 @@ module ImmosquareExtensions
9
9
  end
10
10
  end
11
11
 
12
+ initializer "immosquare_extensions.active_record" do
13
+ ActiveSupport.on_load(:active_record) do
14
+ ActiveRecord::Base.include(ImmosquareExtensions::ApplicationRecord)
15
+ end
16
+ end
17
+
18
+
12
19
  end
13
20
  end
@@ -1,3 +1,3 @@
1
1
  module ImmosquareExtensions
2
- VERSION = "0.1.24".freeze
2
+ VERSION = "0.1.25".freeze
3
3
  end
@@ -1,10 +1,27 @@
1
+ ##============================================================##
2
+ ## Shared Methods (Need to be loaded first)
3
+ ##============================================================##
1
4
  require_relative "immosquare-extensions/shared_methods"
5
+
6
+ ##============================================================##
7
+ ## Extensions
8
+ ##============================================================##
9
+ require_relative "immosquare-extensions/application_record"
2
10
  require_relative "immosquare-extensions/array"
3
11
  require_relative "immosquare-extensions/file"
4
12
  require_relative "immosquare-extensions/hash"
5
13
  require_relative "immosquare-extensions/string"
14
+
15
+ ##============================================================##
16
+ ## Helpers
17
+ ##============================================================##
6
18
  require_relative "immosquare-extensions/helpers/preview_mailer_helper"
19
+
20
+ ##============================================================##
21
+ ## Rails
22
+ ##============================================================##
7
23
  require_relative "immosquare-extensions/railtie" if defined?(Rails)
8
24
 
25
+
9
26
  module ImmosquareExtensions
10
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: immosquare-extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.24
4
+ version: 0.1.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - IMMO SQUARE
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-20 00:00:00.000000000 Z
11
+ date: 2024-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: unicode_utils
@@ -35,6 +35,7 @@ extensions: []
35
35
  extra_rdoc_files: []
36
36
  files:
37
37
  - lib/immosquare-extensions.rb
38
+ - lib/immosquare-extensions/application_record.rb
38
39
  - lib/immosquare-extensions/array.rb
39
40
  - lib/immosquare-extensions/file.rb
40
41
  - lib/immosquare-extensions/hash.rb