salesforce-orm 1.2.4 → 1.2.6

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
  SHA1:
3
- metadata.gz: 2c3330fad57d890e8c8a3dd6a21fe89b38a64538
4
- data.tar.gz: 6b222d1e83135e92ba7b7d4365e3260c041bd6ba
3
+ metadata.gz: d8e15c2e92db3f6c373dd24b862cb718645479bc
4
+ data.tar.gz: 67f8ba56e368b6cefb59beaeb9edc161cffb288d
5
5
  SHA512:
6
- metadata.gz: fe91c0862dd0b88b228276115cdca066cd4f269dfd04709986e4d93fbc2ac8b2c554b7d3c256ddfb0153a935e00d2441c2cf5c7120dfb88fc6f19b252e031341
7
- data.tar.gz: 3fa5d2bfec49d91145a48386c8b381fc3886067fa63fbe0cbb36045caf0f479426c1dcbf781acdb51e6bf7af29853087715cae5d8185041587c0ce87eeda5dd4
6
+ metadata.gz: 6d9984a9349599edcd21bb275bbc2dc020ab6fdee3aed37cbd0718c06387834f93643f29bfd4e04fa4be8fad931a6bb5b948e12b4d6da9fa3b7f82b3d8b41347
7
+ data.tar.gz: 4c0c7d67b0a08a1c9859f1c5f9acedb5abf948574fcef77b5668c07b885a3e3b964ae32ec28096d9300d2e2172ad10cf3020cae89fcd5056cf21b22183e4f41d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- salesforce-orm (1.2.4)
4
+ salesforce-orm (1.2.6)
5
5
  activerecord (~> 3)
6
6
  activerecord-nulldb-adapter (~> 0)
7
7
  restforce (~> 2.5)
data/README.md CHANGED
@@ -189,6 +189,8 @@ SampleObject.find_by_field_one_and_field_two_and_field_three(1, 2, 3)
189
189
  SampleObject.select('count(id)').all
190
190
  ```
191
191
 
192
+ **NOTE: Salesforce API's accepts SOQL query as a URL params, so make sure URL length is not longer than 16087 chars**
193
+
192
194
  Instance methods
193
195
 
194
196
  ```
@@ -72,16 +72,37 @@ module SalesforceOrm
72
72
  def inspect
73
73
  to_h
74
74
  end
75
- end
76
75
 
77
- # Fix for unable to cache object of this class.
78
- # This is a temporary solution. Once Restforce::Mash fix this issue, we'll revert this change
79
- # WARNING: As of now, you can't do any restforce operation on the object of this class which is fetched from cache
80
- def marshal_dump
81
- h = to_h
82
- h[:attributes] = Restforce::Mash.new(attributes.to_h) if attributes
83
- h[:original_object] = Restforce::SObject.new(original_object.to_h) if original_object
84
- h[:original_object][:attributes] = Restforce::Mash.new(original_object.attributes.to_h) if original_object && original_object.attributes
85
- h
76
+ # marshal_dump and marshal_load is a fix for unable to cache object of this class.
77
+ # This is a temporary solution. Once Restforce::Mash fix this issue, we'll revert this change
78
+
79
+ def marshal_dump
80
+ h = to_h
81
+ if h[:attributes]
82
+ h[:attributes] = h[:attributes].clone
83
+ h[:attributes].instance_variable_set(:@client, nil)
84
+ end
85
+
86
+ if h[:original_object]
87
+ h[:original_object] = h[:original_object].clone
88
+ h[:original_object].instance_variable_set(:@client, nil)
89
+
90
+ if h[:original_object]['attributes']
91
+ h[:original_object]['attributes'] = h[:original_object]['attributes'].clone
92
+ h[:original_object]['attributes'].instance_variable_set(:@client, nil)
93
+ end
94
+ end
95
+ h
96
+ end
97
+
98
+ def marshal_load(data)
99
+ result = super(data)
100
+
101
+ attributes.instance_variable_set(:@client, RestforceClient.instance) if attributes
102
+ original_object.instance_variable_set(:@client, RestforceClient.instance) if original_object
103
+ original_object.attributes.instance_variable_set(:@client, RestforceClient.instance) if original_object && original_object.attributes
104
+
105
+ result
106
+ end
86
107
  end
87
108
  end
@@ -1,3 +1,3 @@
1
1
  module SalesforceOrm
2
- VERSION = '1.2.4'.freeze
2
+ VERSION = '1.2.6'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: salesforce-orm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vishal Vijay