as_json_with_includes 0.1.0 → 0.1.1

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: 807b26efdda890952ddc92296e402fb2c414d07d
4
- data.tar.gz: 752a22c47a9a45de074eeb3b55eed7a78e06a948
3
+ metadata.gz: 0437a6d5619f326baf8c5d5581777992f3c8faf2
4
+ data.tar.gz: 4eeb04510297230f5a8d80e5a6cdf70d195bf1e1
5
5
  SHA512:
6
- metadata.gz: f1fa62b5d1814745e3c3638a6a8e5e98c8933d160433a916d033e296d67cbbc590a1975df0f642fce0078572b9e65e07b49c0572d71bcfe53b72e20639fcc768
7
- data.tar.gz: 6350349cb04f9ba4f7b9ed8bc8a775763d415571e909a9cc5a10737e986e8ba5a01dbd79250d1975f1ccf9db3e11f5053765fc5cf4ee6243bcfe9e95a7dc597b
6
+ metadata.gz: 94758e45f8f12d4743fcb76f89e4ee8586d2123c1e58e4e533e2f063140809bfa5259cefbd2c9df0d6ec5d251c2854e1e255bcde8d7aebfbb20e37b2afc91f9f
7
+ data.tar.gz: c7ff2e8996c8e99a71a5189c0e3a53243bd662223fc99be236604475dbe3efa1ba71b041af83c755f40c24d77f9f0d23c7aecebad436ba3fe083f63c0836b0b4
@@ -1,13 +1,13 @@
1
1
  require "as_json_with_includes/version"
2
2
 
3
- module ActiveRecord
4
- class Base
3
+ module AsJsonWithIncludes
4
+ module BasePatch
5
5
  def as_json(options = {})
6
6
  super(options).merge(serializable_hash(options))
7
7
  end
8
8
  end
9
9
 
10
- module Calculations
10
+ module CalculationsPatch
11
11
  def convert_activerecord_includes_to_json_includes(active_record_includes)
12
12
  return active_record_includes if active_record_includes.is_a? Symbol
13
13
  temp_arr = []
@@ -36,3 +36,6 @@ module ActiveRecord
36
36
  end
37
37
  end
38
38
  end
39
+
40
+ ActiveRecord::Base.send(:include, AsJsonWithIncludes::BasePatch)
41
+ ActiveRecord::Calculations.send(:include, AsJsonWithIncludes::CalculationsPatch)
@@ -1,3 +1,3 @@
1
1
  module AsJsonWithIncludes
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: as_json_with_includes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Truong Hoang Dung