Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Use "vebra_ref" as a unique identifier for properties based on id / p…

…roperty_id
  • Loading branch information...
commit a4c381341b0078cc4ace3463de52280ce4185f33 1 parent 1f877b2
authored March 22, 2012
4  lib/vebra/parse.rb
@@ -127,7 +127,7 @@ def parse_value(value)
127 127
     def mappings
128 128
       {
129 129
         'propertyid'  => 'property_id',
130  
-        'prop_id'     => 'property_id',
  130
+        'prop_id'     => 'vebra_ref',
131 131
         'firmid'      => 'firm_id',
132 132
         'branchid'    => 'branch_id',
133 133
         'lastchanged' => 'last_changed',
@@ -224,7 +224,7 @@ def customise(hash)
224 224
       # was: { :attributes => { :id => #<value> } }
225 225
       # now: { :attributes => { :vebra_id => #<value> } }
226 226
       if hash[:attributes] && hash[:attributes][:id]
227  
-        hash[:attributes][:vebra_id] = hash[:attributes].delete(:id)
  227
+        hash[:vebra_ref] = hash[:attributes].delete(:id)
228 228
       end
229 229
 
230 230
       # was: { :price_attributes => { :value => #<value>, ... } }
3  spec/support/expected_output.rb
... ...
@@ -1,6 +1,5 @@
1 1
 PropertyHash = {
2 2
   :attributes => {
3  
-    :vebra_id => 23072663,
4 3
     :property_id => 2678001,
5 4
     :system => "B",
6 5
     :firm_id => 1081,
@@ -9,6 +8,8 @@
9 8
     :featured => 0
10 9
   },
11 10
 
  11
+  :vebra_ref => 23072663,
  12
+
12 13
   :group => :lettings,
13 14
 
14 15
   :agent_reference => nil,

0 notes on commit a4c3813

Please sign in to comment.
Something went wrong with that request. Please try again.