Permalink
Browse files

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

…roperty_id
  • Loading branch information...
1 parent 1f877b2 commit a4c381341b0078cc4ace3463de52280ce4185f33 Mike Fulcher committed Mar 22, 2012
Showing with 4 additions and 3 deletions.
  1. +2 −2 lib/vebra/parse.rb
  2. +2 −1 spec/support/expected_output.rb
View
4 lib/vebra/parse.rb
@@ -127,7 +127,7 @@ def parse_value(value)
def mappings
{
'propertyid' => 'property_id',
- 'prop_id' => 'property_id',
+ 'prop_id' => 'vebra_ref',
'firmid' => 'firm_id',
'branchid' => 'branch_id',
'lastchanged' => 'last_changed',
@@ -224,7 +224,7 @@ def customise(hash)
# was: { :attributes => { :id => #<value> } }
# now: { :attributes => { :vebra_id => #<value> } }
if hash[:attributes] && hash[:attributes][:id]
- hash[:attributes][:vebra_id] = hash[:attributes].delete(:id)
+ hash[:vebra_ref] = hash[:attributes].delete(:id)
end
# was: { :price_attributes => { :value => #<value>, ... } }
View
3 spec/support/expected_output.rb
@@ -1,6 +1,5 @@
PropertyHash = {
:attributes => {
- :vebra_id => 23072663,
:property_id => 2678001,
:system => "B",
:firm_id => 1081,
@@ -9,6 +8,8 @@
:featured => 0
},
+ :vebra_ref => 23072663,
+
:group => :lettings,
:agent_reference => nil,

0 comments on commit a4c3813

Please sign in to comment.