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 +4 -4
- data/lib/as_json_with_includes.rb +6 -3
- data/lib/as_json_with_includes/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0437a6d5619f326baf8c5d5581777992f3c8faf2
|
4
|
+
data.tar.gz: 4eeb04510297230f5a8d80e5a6cdf70d195bf1e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
4
|
-
|
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
|
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)
|