caboose-rets 0.1.18 → 0.1.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/caboose_rets/admin_media.js +7 -7
  3. data/app/assets/javascripts/caboose_rets/caboose_rets.js +8 -8
  4. data/app/controllers/caboose_rets/agents_controller.rb +67 -75
  5. data/app/controllers/caboose_rets/offices_controller.rb +4 -4
  6. data/app/controllers/caboose_rets/open_houses_controller.rb +3 -3
  7. data/app/controllers/caboose_rets/properties_controller.rb +160 -0
  8. data/app/controllers/caboose_rets/rets_controller.rb +2 -2
  9. data/app/controllers/caboose_rets/rets_media_controller.rb +13 -13
  10. data/app/controllers/caboose_rets/saved_properties_controller.rb +35 -35
  11. data/app/models/caboose_rets/agent.rb +42 -55
  12. data/app/models/caboose_rets/agent_meta.rb +7 -7
  13. data/app/models/caboose_rets/media.rb +63 -57
  14. data/app/models/caboose_rets/office.rb +35 -21
  15. data/app/models/caboose_rets/open_house.rb +15 -15
  16. data/app/models/caboose_rets/property.rb +203 -0
  17. data/app/models/caboose_rets/rets_importer.rb +193 -233
  18. data/app/models/caboose_rets/rets_importer_bak.rb +77 -77
  19. data/app/models/caboose_rets/rets_importer_old.rb +625 -0
  20. data/app/models/caboose_rets/saved_property.rb +4 -4
  21. data/app/models/caboose_rets/saved_search.rb +36 -33
  22. data/app/models/caboose_rets/schema.rb +324 -855
  23. data/app/models/caboose_rets/schema_past.rb +918 -0
  24. data/app/models/caboose_rets/search_option.rb +6 -6
  25. data/app/views/caboose/blocks/_layout_rets.html.erb +9 -6
  26. data/app/views/caboose/blocks/_rets_agent_listings.html.erb +3 -3
  27. data/app/views/caboose_rets/agents/index.html.erb +23 -40
  28. data/app/views/caboose_rets/media/admin_property_media.html.erb +2 -2
  29. data/app/views/caboose_rets/{residential → properties}/_search_form.html.erb +42 -42
  30. data/app/views/caboose_rets/{residential → properties}/admin_edit.html.erb +7 -7
  31. data/app/views/caboose_rets/{land → properties}/admin_index.html.erb +11 -11
  32. data/app/views/caboose_rets/properties/details.html.erb +127 -0
  33. data/app/views/caboose_rets/{land → properties}/index.html.erb +0 -0
  34. data/app/views/caboose_rets/{residential/residential_not_exists.html.erb → properties/property_not_exists.html.erb} +4 -5
  35. data/app/views/caboose_rets/{residential → properties}/test_form.html.erb +1 -1
  36. data/app/views/caboose_rets/rets/admin_import_form.html.erb +1 -1
  37. data/config/routes.rb +70 -55
  38. data/lib/caboose-rets.rb +1 -1
  39. data/lib/caboose_rets/engine.rb +3 -3
  40. data/lib/caboose_rets/version.rb +1 -1
  41. data/lib/rets/base/core.rb +1 -1
  42. data/lib/rets/base/sax_search.rb +1 -1
  43. data/lib/tasks/caboose_rets.rake +106 -17
  44. metadata +16 -50
  45. data/app/controllers/caboose_rets/commercial_controller.rb +0 -349
  46. data/app/controllers/caboose_rets/land_controller.rb +0 -144
  47. data/app/controllers/caboose_rets/multi_family_controller.rb +0 -107
  48. data/app/controllers/caboose_rets/residential_controller.rb +0 -163
  49. data/app/models/caboose_rets/commercial_property.rb +0 -214
  50. data/app/models/caboose_rets/land_property.rb +0 -144
  51. data/app/models/caboose_rets/multi_family_property.rb +0 -199
  52. data/app/models/caboose_rets/residential_property.rb +0 -236
  53. data/app/views/caboose/blocks/_rets_commercial_details.html.erb +0 -192
  54. data/app/views/caboose/blocks/_rets_commercial_headers.html.erb +0 -17
  55. data/app/views/caboose/blocks/_rets_commercial_index.html.erb +0 -71
  56. data/app/views/caboose/blocks/_rets_commercial_row.html.erb +0 -39
  57. data/app/views/caboose/blocks/_rets_commercial_search_form.html.erb +0 -201
  58. data/app/views/caboose/blocks/_rets_land_details.html.erb +0 -165
  59. data/app/views/caboose/blocks/_rets_land_index.html.erb +0 -63
  60. data/app/views/caboose/blocks/_rets_land_row.html.erb +0 -58
  61. data/app/views/caboose/blocks/_rets_land_search_form.html.erb +0 -194
  62. data/app/views/caboose/blocks/_rets_multifamily_details.html.erb +0 -161
  63. data/app/views/caboose/blocks/_rets_multifamily_index.html.erb +0 -63
  64. data/app/views/caboose/blocks/_rets_multifamily_row.html.erb +0 -56
  65. data/app/views/caboose/blocks/_rets_multifamily_search_form.html.erb +0 -273
  66. data/app/views/caboose/blocks/_rets_openhouse_details.html.erb +0 -12
  67. data/app/views/caboose/blocks/_rets_openhouses_index.html.erb +0 -79
  68. data/app/views/caboose/blocks/_rets_residential_details.html.erb +0 -243
  69. data/app/views/caboose/blocks/_rets_residential_index.html.erb +0 -65
  70. data/app/views/caboose/blocks/_rets_residential_row.html.erb +0 -59
  71. data/app/views/caboose/blocks/_rets_residential_search_form.html.erb +0 -304
  72. data/app/views/caboose_rets/commercial/admin_edit.html.erb +0 -269
  73. data/app/views/caboose_rets/commercial/admin_index.html.erb +0 -51
  74. data/app/views/caboose_rets/commercial/admin_new.html.erb +0 -57
  75. data/app/views/caboose_rets/commercial/details.html.erb +0 -0
  76. data/app/views/caboose_rets/commercial/index.html.erb +0 -87
  77. data/app/views/caboose_rets/land/admin_edit.html.erb +0 -156
  78. data/app/views/caboose_rets/land/details.html.erb +0 -0
  79. data/app/views/caboose_rets/multi_family/admin_edit.html.erb +0 -211
  80. data/app/views/caboose_rets/multi_family/admin_index.html.erb +0 -46
  81. data/app/views/caboose_rets/residential/admin_index.html.erb +0 -46
  82. data/app/views/caboose_rets/residential/details.html.erb +0 -0
  83. data/app/views/caboose_rets/residential/index.html.erb +0 -0
@@ -1,144 +0,0 @@
1
-
2
- class CabooseRets::LandProperty < ActiveRecord::Base
3
- self.table_name = "rets_land"
4
- attr_accessible :id, :mls_acct
5
-
6
- def url() return "/land/#{self.id}" end
7
- def agent() return CabooseRets::Agent.where(:la_code => self.la_code).first end
8
- def office() return CabooseRets::Office.where(:lo_code => self.lo_code).first end
9
- def images() return CabooseRets::Media.where(:mls_acct => self.mls_acct, :media_type => 'Photo').reorder(:media_order).all end
10
- def files() return CabooseRets::Media.where(:mls_acct => self.mls_acct, :media_type => 'File' ).reorder(:media_order).all end
11
- def virtual_tour
12
- return nil if !CabooseRets::Media.where(:mls_acct => self.mls_acct.to_s).where(:media_type => 'Virtual Tour').exists?
13
- media = CabooseRets::Media.where(:mls_acct => self.mls_acct.to_s, :media_type => 'Virtual Tour').first
14
- return media.url
15
- end
16
- def self.geolocatable() all(conditions: "latitude IS NOT NULL AND longitude IS NOT NULL") end
17
-
18
- def refresh_from_mls
19
- CabooseRets::RetsImporter.import_land_property(self.mls_acct)
20
- end
21
-
22
- def parse(data)
23
- self.acreage = data['ACREAGE']
24
- self.acreage_source = data['ACREAGE_SOURCE']
25
- self.adjoining_land_use = data['ADJOINING_LAND_USE']
26
- self.agent_notes = data['AGENT_NOTES']
27
- self.agent_other_contact_desc = data['AGENT_OTHER_CONTACT_DESC']
28
- self.agent_other_contact_phone = data['AGENT_OTHER_CONTACT_PHONE']
29
- self.annual_taxes = data['ANNUAL_TAXES']
30
- self.area = data['AREA']
31
- self.bom_date = data['BOM_DATE']
32
- self.book_number = data['BOOK_NUMBER']
33
- self.book_page = data['BOOK_PAGE']
34
- self.book_type = data['BOOK_TYPE']
35
- self.buyer_broker = data['BUYER_BROKER']
36
- self.buyer_broker_type = data['BUYER_BROKER_TYPE']
37
- self.buyer_name = data['BUYER_NAME']
38
- self.category = data['CATEGORY']
39
- self.city = data['CITY']
40
- self.city_code = data['CITY_CODE']
41
- self.co_la_code = data['CO_LA_CODE']
42
- self.co_lo_code = data['CO_LO_CODE']
43
- self.co_sa_code = data['CO_SA_CODE']
44
- self.co_so_code = data['CO_SO_CODE']
45
- self.contacts = data['CONTACTS']
46
- self.contr_broker = data['CONTR_BROKER']
47
- self.contr_broker_type = data['CONTR_BROKER_TYPE']
48
- self.converted = data['CONVERTED']
49
- self.county = data['COUNTY']
50
- self.current_price = data['CURRENT_PRICE']
51
- self.date_created = data['DATE_CREATED']
52
- self.date_modified = data['DATE_MODIFIED']
53
- self.df_yn = data['DF_YN']
54
- self.directions = data['DIRECTIONS']
55
- self.display_address_yn = data['DISPLAY_ADDRESS_YN']
56
- self.dom = data['DOM']
57
- self.elem_school = data['ELEM_SCHOOL']
58
- self.expire_date = data['EXPIRE_DATE']
59
- self.ftr_access = data['FTR_ACCESS']
60
- self.ftr_docs_on_file = data['FTR_DOCS_ON_FILE']
61
- self.ftr_existing_struct = data['FTR_EXISTING_STRUCT']
62
- self.ftr_extras = data['FTR_EXTRAS']
63
- self.ftr_internet = data['FTR_INTERNET']
64
- self.ftr_lotdesc = data['FTR_LOTDESC']
65
- self.ftr_mineralrights = data['FTR_MINERALRIGHTS']
66
- self.ftr_possibleuse = data['FTR_POSSIBLEUSE']
67
- self.ftr_restrictions = data['FTR_RESTRICTIONS']
68
- self.ftr_sewer = data['FTR_SEWER']
69
- self.ftr_showing = data['FTR_SHOWING']
70
- self.ftr_terms = data['FTR_TERMS']
71
- self.ftr_topography = data['FTR_TOPOGRAPHY']
72
- self.ftr_utils = data['FTR_UTILS']
73
- self.ftr_zoning = data['FTR_ZONING']
74
- self.geo_precision = data['GEO_PRECISION']
75
- self.georesult = data['GEORESULT']
76
- self.high_school = data['HIGH_SCHOOL']
77
- self.internet_yn = data['INTERNET_YN']
78
- self.la_code = data['LA_CODE']
79
- self.legal_block = data['LEGAL_BLOCK']
80
- self.legal_lot = data['LEGAL_LOT']
81
- self.legal_section = data['LEGAL_SECTION']
82
- self.legals = data['LEGALS']
83
- self.list_date = data['LIST_DATE']
84
- self.list_price = data['LIST_PRICE']
85
- self.listing_type = data['LISTING_TYPE']
86
- self.lo_code = data['LO_CODE']
87
- self.lot_dim_source = data['LOT_DIM_SOURCE']
88
- self.lot_dimensions = data['LOT_DIMENSIONS']
89
- self.media_flag = data['MEDIA_FLAG']
90
- self.middle_school = data['MIDDLE_SCHOOL']
91
- self.mls_acct = data['MLS_ACCT']
92
- self.municipality = data['MUNICIPALITY']
93
- self.off_mkt_date = data['OFF_MKT_DATE']
94
- self.off_mkt_days = data['OFF_MKT_DAYS']
95
- self.office_notes = data['OFFICE_NOTES']
96
- self.orig_lp = data['ORIG_LP']
97
- self.orig_price = data['ORIG_PRICE']
98
- self.other_fee = data['OTHER_FEE']
99
- self.other_fee_type = data['OTHER_FEE_TYPE']
100
- self.owner_name = data['OWNER_NAME']
101
- self.owner_phone = data['OWNER_PHONE']
102
- self.parcel_id = data['PARCEL_ID']
103
- self.pending_date = data['PENDING_DATE']
104
- self.photo_count = data['PHOTO_COUNT']
105
- self.photo_date_modified = data['PHOTO_DATE_MODIFIED']
106
- self.price_change_date = data['PRICE_CHANGE_DATE']
107
- self.price_sqft = data['PRICE_SQFT']
108
- self.proj_close_date = data['PROJ_CLOSE_DATE']
109
- self.prop_id = data['PROP_ID']
110
- self.prop_type = data['PROP_TYPE']
111
- self.remarks = data['REMARKS']
112
- self.road_frontage_ft = data['ROAD_FRONTAGE_FT']
113
- self.sa_code = data['SA_CODE']
114
- self.sale_lease = data['SALE_LEASE']
115
- self.sale_notes = data['SALE_NOTES']
116
- self.so_code = data['SO_CODE']
117
- self.sold_date = data['SOLD_DATE']
118
- self.sold_price = data['SOLD_PRICE']
119
- self.sold_terms = data['SOLD_TERMS']
120
- self.state = data['STATE']
121
- self.status = data['STATUS']
122
- self.status_date = data['STATUS_DATE']
123
- self.status_flag = data['STATUS_FLAG']
124
- self.street = data['STREET']
125
- self.street_dir = data['STREET_DIR']
126
- self.street_name = data['STREET_NAME']
127
- self.street_num = data['STREET_NUM']
128
- self.sub_agent = data['SUB_AGENT']
129
- self.sub_agent_type = data['SUB_AGENT_TYPE']
130
- self.subdivision = data['SUBDIVISION']
131
- self.third_party_comm_yn = data['THIRD_PARTY_COMM_YN']
132
- self.unit_num = data['UNIT_NUM']
133
- self.upload_source = data['UPLOAD_SOURCE']
134
- self.valuation_yn = data['VALUATION_YN']
135
- self.vt_yn = data['VT_YN']
136
- self.waterfront = data['WATERFRONT']
137
- self.waterfront_yn = data['WATERFRONT_YN']
138
- self.wf_feet = data['WF_FEET']
139
- self.withdrawn_date = data['WITHDRAWN_DATE']
140
- self.zip = data['ZIP']
141
- self.zoning_northport = data['ZONING_NORTHPORT']
142
- self.zoning_tusc = data['ZONING_TUSC']
143
- end
144
- end
@@ -1,199 +0,0 @@
1
-
2
- class CabooseRets::MultiFamilyProperty < ActiveRecord::Base
3
- self.table_name = "rets_multi_family"
4
- attr_accessible :id, :mls_acct
5
-
6
- def url() return "/multi-family/#{self.id}" end
7
- def agent() return CabooseRets::Agent.where(:la_code => self.la_code).first end
8
- def office() return CabooseRets::Office.where(:lo_code => self.lo_code).first end
9
- def images() return CabooseRets::Media.where(:mls_acct => self.mls_acct, :media_type => 'Photo').reorder(:media_order).all end
10
- def files() return CabooseRets::Media.where(:mls_acct => self.mls_acct, :media_type => 'File' ).reorder(:media_order).all end
11
- def virtual_tour
12
- return nil if !CabooseRets::Media.where(:mls_acct => self.mls_acct.to_s).where(:media_type => 'Virtual Tour').exists?
13
- media = CabooseRets::Media.where(:mls_acct => self.mls_acct.to_s, :media_type => 'Virtual Tour').first
14
- return media.url
15
- end
16
- def self.geolocatable() all(conditions: "latitude IS NOT NULL AND longitude IS NOT NULL") end
17
-
18
- def refresh_from_mls
19
- CabooseRets::RetsImporter.import_multi_family_property(self.mls_acct)
20
- end
21
-
22
- def parse(data)
23
- self.acreage = data['ACREAGE']
24
- self.agent_notes = data['AGENT_NOTES']
25
- self.agent_other_contact_desc = data['AGENT_OTHER_CONTACT_DESC']
26
- self.agent_other_contact_phone = data['AGENT_OTHER_CONTACT_PHONE']
27
- self.annual_taxes = data['ANNUAL_TAXES']
28
- self.area = data['AREA']
29
- self.bom_date = data['BOM_DATE']
30
- self.book_number = data['BOOK_NUMBER']
31
- self.book_page = data['BOOK_PAGE']
32
- self.book_type = data['BOOK_TYPE']
33
- self.box_on_unit = data['BOX_ON_UNIT']
34
- self.buyer_broker = data['BUYER_BROKER']
35
- self.buyer_broker_type = data['BUYER_BROKER_TYPE']
36
- self.buyer_name = data['BUYER_NAME']
37
- self.category = data['CATEGORY']
38
- self.city = data['CITY']
39
- self.city_code = data['CITY_CODE']
40
- self.contacts = data['CONTACTS']
41
- self.contr_broker = data['CONTR_BROKER']
42
- self.contr_broker_type = data['CONTR_BROKER_TYPE']
43
- self.county = data['COUNTY']
44
- self.co_la_code = data['CO_LA_CODE']
45
- self.co_lo_code = data['CO_LO_CODE']
46
- self.co_sa_code = data['CO_SA_CODE']
47
- self.co_so_code = data['CO_SO_CODE']
48
- self.current_price = data['CURRENT_PRICE']
49
- self.date_created = data['DATE_CREATED']
50
- self.date_leased = data['DATE_LEASED']
51
- self.date_modified = data['DATE_MODIFIED']
52
- self.df_yn = data['DF_YN']
53
- self.directions = data['DIRECTIONS']
54
- self.display_address_yn = data['DISPLAY_ADDRESS_YN']
55
- self.dom = data['DOM']
56
- self.elem_school = data['ELEM_SCHOOL']
57
- self.expenses_association = data['EXPENSES_ASSOCIATION']
58
- self.expenses_insurance = data['EXPENSES_INSURANCE']
59
- self.expenses_maintenance = data['EXPENSES_MAINTENANCE']
60
- self.expenses_management = data['EXPENSES_MANAGEMENT']
61
- self.expenses_other = data['EXPENSES_OTHER']
62
- self.expenses_tax = data['EXPENSES_TAX']
63
- self.expire_date = data['EXPIRE_DATE']
64
- self.flood_plain = data['FLOOD_PLAIN']
65
- self.ftr_building_type = data['FTR_BUILDING_TYPE']
66
- self.ftr_construction = data['FTR_CONSTRUCTION']
67
- self.ftr_cooling = data['FTR_COOLING']
68
- self.ftr_exterior = data['FTR_EXTERIOR']
69
- self.ftr_exterioramenit = data['FTR_EXTERIORAMENIT']
70
- self.ftr_floors = data['FTR_FLOORS']
71
- self.ftr_heating = data['FTR_HEATING']
72
- self.ftr_interior = data['FTR_INTERIOR']
73
- self.ftr_rent_incl = data['FTR_RENT_INCL']
74
- self.ftr_roof = data['FTR_ROOF']
75
- self.ftr_roof_age = data['FTR_ROOF_AGE']
76
- self.ftr_showing = data['FTR_SHOWING']
77
- self.ftr_utils = data['FTR_UTILS']
78
- self.ftr_zoning = data['FTR_ZONING']
79
- self.georesult = data['GEORESULT']
80
- self.geo_precision = data['GEO_PRECISION']
81
- self.high_school = data['HIGH_SCHOOL']
82
- self.hoa_fee = data['HOA_FEE']
83
- self.hoa_fee_yn = data['HOA_FEE_YN']
84
- self.hoa_term = data['HOA_TERM']
85
- self.income = data['INCOME']
86
- self.income_other = data['INCOME_OTHER']
87
- self.income_rent = data['INCOME_RENT']
88
- self.internet_yn = data['INTERNET_YN']
89
- self.la_code = data['LA_CODE']
90
- self.legals = data['LEGALS']
91
- self.limited_service_yn = data['LIMITED_SERVICE_YN']
92
- self.listing_type = data['LISTING_TYPE']
93
- self.list_date = data['LIST_DATE']
94
- self.list_price = data['LIST_PRICE']
95
- self.lot_dimensions = data['LOT_DIMENSIONS']
96
- self.lot_dimensions_source = data['LOT_DIMENSIONS_SOURCE']
97
- self.lo_code = data['LO_CODE']
98
- self.management = data['MANAGEMENT']
99
- self.media_flag = data['MEDIA_FLAG']
100
- self.middle_school = data['MIDDLE_SCHOOL']
101
- self.mls_acct = data['MLS_ACCT']
102
- self.municipality = data['MUNICIPALITY']
103
- self.num_units = data['NUM_UNITS']
104
- self.num_units_occupied = data['NUM_UNITS_OCCUPIED']
105
- self.office_notes = data['OFFICE_NOTES']
106
- self.off_mkt_date = data['OFF_MKT_DATE']
107
- self.off_mkt_days = data['OFF_MKT_DAYS']
108
- self.orig_lp = data['ORIG_LP']
109
- self.orig_price = data['ORIG_PRICE']
110
- self.other_fee = data['OTHER_FEE']
111
- self.other_fee_type = data['OTHER_FEE_TYPE']
112
- self.owner_name = data['OWNER_NAME']
113
- self.owner_phone = data['OWNER_PHONE']
114
- self.parcel_id = data['PARCEL_ID']
115
- self.pending_date = data['PENDING_DATE']
116
- self.photo_count = data['PHOTO_COUNT']
117
- self.photo_date_modified = data['PHOTO_DATE_MODIFIED']
118
- self.price_change_date = data['PRICE_CHANGE_DATE']
119
- self.price_sqft = data['PRICE_SQFT']
120
- self.proj_close_date = data['PROJ_CLOSE_DATE']
121
- self.prop_id = data['PROP_ID']
122
- self.prop_type = data['PROP_TYPE']
123
- self.remarks = data['REMARKS']
124
- self.sale_notes = data['SALE_NOTES']
125
- self.sale_rent = data['SALE_RENT']
126
- self.sa_code = data['SA_CODE']
127
- self.sold_date = data['SOLD_DATE']
128
- self.sold_price = data['SOLD_PRICE']
129
- self.sold_terms = data['SOLD_TERMS']
130
- self.so_code = data['SO_CODE']
131
- self.state = data['STATE']
132
- self.status = data['STATUS']
133
- self.status_date = data['STATUS_DATE']
134
- self.status_flag = data['STATUS_FLAG']
135
- self.street = data['STREET']
136
- self.street_dir = data['STREET_DIR']
137
- self.street_name = data['STREET_NAME']
138
- self.street_num = data['STREET_NUM']
139
- self.subdivision = data['SUBDIVISION']
140
- self.sub_agent = data['SUB_AGENT']
141
- self.sub_agent_type = data['SUB_AGENT_TYPE']
142
- self.third_party_comm_yn = data['THIRD_PARTY_COMM_YN']
143
- self.tot_heat_sqft = data['TOT_HEAT_SQFT']
144
- self.u1_baths = data['U1_BATHS']
145
- self.u1_num = data['U1_NUM']
146
- self.u1_occ = data['U1_OCC']
147
- self.u1_rent = data['U1_RENT']
148
- self.u1_sqft = data['U1_SQFT']
149
- self.u1_yn = data['U1_YN']
150
- self.u2_baths = data['U2_BATHS']
151
- self.u2_num = data['U2_NUM']
152
- self.u2_occ = data['U2_OCC']
153
- self.u2_rent = data['U2_RENT']
154
- self.u2_sqft = data['U2_SQFT']
155
- self.u2_yn = data['U2_YN']
156
- self.u3_baths = data['U3_BATHS']
157
- self.u3_num = data['U3_NUM']
158
- self.u3_occ = data['U3_OCC']
159
- self.u3_rent = data['U3_RENT']
160
- self.u3_sqft = data['U3_SQFT']
161
- self.u3_yn = data['U3_YN']
162
- self.u4_baths = data['U4_BATHS']
163
- self.u4_num = data['U4_NUM']
164
- self.u4_occ = data['U4_OCC']
165
- self.u4_rent = data['U4_RENT']
166
- self.u4_sqft = data['U4_SQFT']
167
- self.u4_yn = data['U4_YN']
168
- self.u5_baths = data['U5_BATHS']
169
- self.u5_num = data['U5_NUM']
170
- self.u5_occ = data['U5_OCC']
171
- self.u5_rent = data['U5_RENT']
172
- self.u5_sqft = data['U5_SQFT']
173
- self.u5_yn = data['U5_YN']
174
- self.u6_baths = data['U6_BATHS']
175
- self.u6_num = data['U6_NUM']
176
- self.u6_occ = data['U6_OCC']
177
- self.u6_rent = data['U6_RENT']
178
- self.u6_sqft = data['U6_SQFT']
179
- self.u6_yn = data['U6_YN']
180
- self.u7_baths = data['U7_BATHS']
181
- self.u7_num = data['U7_NUM']
182
- self.u7_occ = data['U7_OCC']
183
- self.u7_rent = data['U7_RENT']
184
- self.u7_sqft = data['U7_SQFT']
185
- self.u7_yn = data['U7_YN']
186
- self.u8_num = data['U8_NUM']
187
- self.u8_occ = data['U8_OCC']
188
- self.u8_rent = data['U8_RENT']
189
- self.u8_sqft = data['U8_SQFT']
190
- self.u8_yn = data['U8_YN']
191
- self.unit_num = data['UNIT_NUM']
192
- self.upload_source = data['UPLOAD_SOURCE']
193
- self.valuation_yn = data['VALUATION_YN']
194
- self.vt_yn = data['VT_YN']
195
- self.withdrawn_date = data['WITHDRAWN_DATE']
196
- self.year_built = data['YEAR_BUILT']
197
- self.zip = data['ZIP']
198
- end
199
- end
@@ -1,236 +0,0 @@
1
-
2
- class CabooseRets::ResidentialProperty < ActiveRecord::Base
3
- self.table_name = "rets_residential"
4
- attr_accessible :id, :mls_acct
5
-
6
- def url() return "/residential/#{self.id}" end
7
- def agent() return CabooseRets::Agent.where(:la_code => self.la_code).first end
8
- def office() return CabooseRets::Office.where(:lo_code => self.lo_code).first end
9
- def images() return CabooseRets::Media.where(:mls_acct => self.mls_acct, :media_type => 'Photo').reorder(:media_order).all end
10
- def files() return CabooseRets::Media.where(:mls_acct => self.mls_acct, :media_type => 'File' ).reorder(:media_order).all end
11
- def virtual_tour
12
- return nil if !CabooseRets::Media.where(:mls_acct => self.mls_acct.to_s).where(:media_type => 'Virtual Tour').exists?
13
- media = CabooseRets::Media.where(:mls_acct => self.mls_acct.to_s, :media_type => 'Virtual Tour').first
14
- return media.url
15
- end
16
- def self.geolocatable() all(conditions: "latitude IS NOT NULL AND longitude IS NOT NULL") end
17
-
18
- def refresh_from_mls
19
- CabooseRets::RetsImporter.import_residential_property(self.mls_acct)
20
- end
21
-
22
- def parse(data)
23
- self.bedrooms = data['BEDROOMS']
24
- self.dom = data['DOM']
25
- self.ftr_pool = data['FTR_POOL']
26
- self.rm_other3_desc = data['RM_OTHER3_DESC']
27
- self.baths_full = data['BATHS_FULL']
28
- self.ftr_diningroom = data['FTR_DININGROOM']
29
- self.ftr_porchpatio = data['FTR_PORCHPATIO']
30
- self.rm_other3_name = data['RM_OTHER3_NAME']
31
- self.baths_half = data['BATHS_HALF']
32
- self.directions = data['DIRECTIONS']
33
- self.ftr_possession = data['FTR_POSSESSION']
34
- self.rm_other4 = data['RM_OTHER4']
35
- self.baths = data['BATHS']
36
- self.display_address_yn = data['DISPLAY_ADDRESS_YN']
37
- self.current_price = data['CURRENT_PRICE']
38
- self.rm_other4_desc = data['RM_OTHER4_DESC']
39
- self.avm_automated_sales_disabled = data['AVM_AUTOMATED_SALES_DISABLED']
40
- self.ftr_drive = data['FTR_DRIVE']
41
- self.price_change_date = data['PRICE_CHANGE_DATE']
42
- self.rm_other4_name = data['RM_OTHER4_NAME']
43
- self.avm_instant_valuation_disabled = data['AVM_INSTANT_VALUATION_DISABLED']
44
- self.elem_school = data['ELEM_SCHOOL']
45
- self.price_sqft = data['PRICE_SQFT']
46
- self.rm_recrm = data['RM_RECRM']
47
- self.acreage = data['ACREAGE']
48
- self.expire_date = data['EXPIRE_DATE']
49
- self.prop_type = data['PROP_TYPE']
50
- self.rm_recrm_desc = data['RM_RECRM_DESC']
51
- self.ftr_age = data['FTR_AGE']
52
- self.ftr_exterior = data['FTR_EXTERIOR']
53
- self.rm_bath1 = data['RM_BATH1']
54
- self.rm_study = data['RM_STUDY']
55
- self.agent_notes = data['AGENT_NOTES']
56
- self.ftr_citycommunit = data['FTR_CITYCOMMUNIT']
57
- self.rm_bath1_desc = data['RM_BATH1_DESC']
58
- self.rm_study_desc = data['RM_STUDY_DESC']
59
- self.agent_other_contact_desc = data['AGENT_OTHER_CONTACT_DESC']
60
- self.ftr_fireplace = data['FTR_FIREPLACE']
61
- self.rm_bath2 = data['RM_BATH2']
62
- self.rm_sun = data['RM_SUN']
63
- self.agent_other_contact_phone = data['AGENT_OTHER_CONTACT_PHONE']
64
- self.flood_plain = data['FLOOD_PLAIN']
65
- self.rm_bath2_desc = data['RM_BATH2_DESC']
66
- self.rm_sun_desc = data['RM_SUN_DESC']
67
- self.annual_taxes = data['ANNUAL_TAXES']
68
- self.foreclosure_yn = data['FORECLOSURE_YN']
69
- self.rm_bath3 = data['RM_BATH3']
70
- self.remarks = data['REMARKS']
71
- self.internet_yn = data['INTERNET_YN']
72
- self.georesult = data['GEORESULT']
73
- self.rm_bath3_desc = data['RM_BATH3_DESC']
74
- self.right_red_date = data['RIGHT_RED_DATE']
75
- self.ftr_appliances = data['FTR_APPLIANCES']
76
- self.ftr_garage = data['FTR_GARAGE']
77
- self.rm_br1 = data['RM_BR1']
78
- self.ftr_roof = data['FTR_ROOF']
79
- self.tot_heat_sqft = data['TOT_HEAT_SQFT']
80
- self.geo_precision = data['GEO_PRECISION']
81
- self.rm_br1_desc = data['RM_BR1_DESC']
82
- self.status_flag = data['STATUS_FLAG']
83
- self.area = data['AREA']
84
- self.ftr_hoaamenities = data['FTR_HOAAMENITIES']
85
- self.rm_br2 = data['RM_BR2']
86
- self.hoa_fee = data['HOA_FEE']
87
- self.ftr_hoaincludes = data['FTR_HOAINCLUDES']
88
- self.rm_br2_desc = data['RM_BR2_DESC']
89
- self.sale_notes = data['SALE_NOTES']
90
- self.hoa_term = data['HOA_TERM']
91
- self.hoa_fee_yn = data['HOA_FEE_YN']
92
- self.rm_br3 = data['RM_BR3']
93
- self.ftr_terms = data['FTR_TERMS']
94
- self.ftr_attic = data['FTR_ATTIC']
95
- self.ftr_heating = data['FTR_HEATING']
96
- self.rm_br3_desc = data['RM_BR3_DESC']
97
- self.sale_lease = data['SALE_LEASE']
98
- self.ftr_docs_on_file = data['FTR_DOCS_ON_FILE']
99
- self.high_school = data['HIGH_SCHOOL']
100
- self.rm_br4 = data['RM_BR4']
101
- self.owner_name = data['OWNER_NAME']
102
- self.bom_date = data['BOM_DATE']
103
- self.homestead_yn = data['HOMESTEAD_YN']
104
- self.rm_br4_desc = data['RM_BR4_DESC']
105
- self.owner_phone = data['OWNER_PHONE']
106
- self.basement_yn = data['BASEMENT_YN']
107
- self.ftr_interior = data['FTR_INTERIOR']
108
- self.rm_br5 = data['RM_BR5']
109
- self.sa_code = data['SA_CODE']
110
- self.ftr_basement = data['FTR_BASEMENT']
111
- self.lease_exp_date = data['LEASE_EXP_DATE']
112
- self.rm_br5_desc = data['RM_BR5_DESC']
113
- self.so_code = data['SO_CODE']
114
- self.book_number = data['BOOK_NUMBER']
115
- self.ftr_landscaping = data['FTR_LANDSCAPING']
116
- self.rm_brkfst = data['RM_BRKFST']
117
- self.ftr_sewer = data['FTR_SEWER']
118
- self.book_page = data['BOOK_PAGE']
119
- self.ftr_laundry = data['FTR_LAUNDRY']
120
- self.rm_brkfst_desc = data['RM_BRKFST_DESC']
121
- self.ftr_showing = data['FTR_SHOWING']
122
- self.book_type = data['BOOK_TYPE']
123
- self.legals = data['LEGALS']
124
- self.rm_den = data['RM_DEN']
125
- self.sold_date = data['SOLD_DATE']
126
- self.buyer_name = data['BUYER_NAME']
127
- self.levels = data['LEVELS']
128
- self.rm_den_desc = data['RM_DEN_DESC']
129
- self.sold_price = data['SOLD_PRICE']
130
- self.city_code = data['CITY_CODE']
131
- self.list_price = data['LIST_PRICE']
132
- self.rm_dining = data['RM_DINING']
133
- self.sold_terms = data['SOLD_TERMS']
134
- self.converted = data['CONVERTED']
135
- self.list_date = data['LIST_DATE']
136
- self.rm_dining_desc = data['RM_DINING_DESC']
137
- self.sqft_source = data['SQFT_SOURCE']
138
- self.currentlease_yn = data['CURRENTLEASE_YN']
139
- self.status = data['STATUS']
140
- self.rm_family = data['RM_FAMILY']
141
- self.state = data['STATE']
142
- self.category = data['CATEGORY']
143
- self.listing_type = data['LISTING_TYPE']
144
- self.rm_family_desc = data['RM_FAMILY_DESC']
145
- self.street_dir = data['STREET_DIR']
146
- self.city = data['CITY']
147
- self.la_code = data['LA_CODE']
148
- self.rm_foyer = data['RM_FOYER']
149
- self.street_name = data['STREET_NAME']
150
- self.co_la_code = data['CO_LA_CODE']
151
- self.lo_code = data['LO_CODE']
152
- self.rm_foyer_desc = data['RM_FOYER_DESC']
153
- self.street_num = data['STREET_NUM']
154
- self.co_lo_code = data['CO_LO_CODE']
155
- self.ftr_lotdesc = data['FTR_LOTDESC']
156
- self.rm_great = data['RM_GREAT']
157
- self.style = data['STYLE']
158
- self.co_so_code = data['CO_SO_CODE']
159
- self.lot_dimensions = data['LOT_DIMENSIONS']
160
- self.rm_great_desc = data['RM_GREAT_DESC']
161
- self.subdivision = data['SUBDIVISION']
162
- self.co_sa_code = data['CO_SA_CODE']
163
- self.mls_acct = data['MLS_ACCT']
164
- self.rm_kitchen = data['RM_KITCHEN']
165
- self.take_photo_yn = data['TAKE_PHOTO_YN']
166
- self.buyer_broker = data['BUYER_BROKER']
167
- self.master_bed_lvl = data['MASTER_BED_LVL']
168
- self.rm_kitchen2 = data['RM_KITCHEN2']
169
- self.upload_source = data['UPLOAD_SOURCE']
170
- self.buyer_broker_type = data['BUYER_BROKER_TYPE']
171
- self.middle_school = data['MIDDLE_SCHOOL']
172
- self.rm_kitchen2_desc = data['RM_KITCHEN2_DESC']
173
- self.unit_num = data['UNIT_NUM']
174
- self.sub_agent = data['SUB_AGENT']
175
- self.ftr_miscellaneous = data['FTR_MISCELLANEOUS']
176
- self.rm_kitchen_desc = data['RM_KITCHEN_DESC']
177
- self.valuation_yn = data['VALUATION_YN']
178
- self.sub_agent_type = data['SUB_AGENT_TYPE']
179
- self.other_fee = data['OTHER_FEE']
180
- self.rm_laundry = data['RM_LAUNDRY']
181
- self.third_party_comm_yn = data['THIRD_PARTY_COMM_YN']
182
- self.contr_broker = data['CONTR_BROKER']
183
- self.off_mkt_date = data['OFF_MKT_DATE']
184
- self.rm_laundry_desc = data['RM_LAUNDRY_DESC']
185
- self.vt_yn = data['VT_YN']
186
- self.contr_broker_type = data['CONTR_BROKER_TYPE']
187
- self.off_mkt_days = data['OFF_MKT_DAYS']
188
- self.rm_living = data['RM_LIVING']
189
- self.ftr_warrantyprogrm = data['FTR_WARRANTYPROGRM']
190
- self.construction_date_comp = data['CONSTRUCTION_DATE_COMP']
191
- self.outlier_yn = data['OUTLIER_YN']
192
- self.rm_living_desc = data['RM_LIVING_DESC']
193
- self.wf_feet = data['WF_FEET']
194
- self.ftr_construction = data['FTR_CONSTRUCTION']
195
- self.office_notes = data['OFFICE_NOTES']
196
- self.rm_lrdr = data['RM_LRDR']
197
- self.ftr_waterheater = data['FTR_WATERHEATER']
198
- self.construction_status = data['CONSTRUCTION_STATUS']
199
- self.onsite_yn = data['ONSITE_YN']
200
- self.rm_lrdr_desc = data['RM_LRDR_DESC']
201
- self.ftr_watersupply = data['FTR_WATERSUPPLY']
202
- self.contacts = data['CONTACTS']
203
- self.onsite_days_hours = data['ONSITE_DAYS_HOURS']
204
- self.rm_master = data['RM_MASTER']
205
- self.waterfront = data['WATERFRONT']
206
- self.ftr_cooling = data['FTR_COOLING']
207
- self.orig_lp = data['ORIG_LP']
208
- self.rm_master_desc = data['RM_MASTER_DESC']
209
- self.ftr_window_treat = data['FTR_WINDOW_TREAT']
210
- self.county = data['COUNTY']
211
- self.other_fee_type = data['OTHER_FEE_TYPE']
212
- self.rm_other1 = data['RM_OTHER1']
213
- self.ftr_windows = data['FTR_WINDOWS']
214
- self.df_yn = data['DF_YN']
215
- self.photo_count = data['PHOTO_COUNT']
216
- self.rm_other1_desc = data['RM_OTHER1_DESC']
217
- self.year_built = data['YEAR_BUILT']
218
- self.date_modified = data['DATE_MODIFIED']
219
- self.photo_date_modified = data['PHOTO_DATE_MODIFIED']
220
- self.rm_other1_name = data['RM_OTHER1_NAME']
221
- self.year_built_source = data['YEAR_BUILT_SOURCE']
222
- self.status_date = data['STATUS_DATE']
223
- self.prop_id = data['PROP_ID']
224
- self.rm_other2 = data['RM_OTHER2']
225
- self.zip = data['ZIP']
226
- self.date_created = data['DATE_CREATED']
227
- self.parcel_id = data['PARCEL_ID']
228
- self.rm_other2_desc = data['RM_OTHER2_DESC']
229
- self.proj_close_date = data['PROJ_CLOSE_DATE']
230
- self.pending_date = data['PENDING_DATE']
231
- self.rm_other2_name = data['RM_OTHER2_NAME']
232
- self.withdrawn_date = data['WITHDRAWN_DATE']
233
- self.media_flag = data['MEDIA_FLAG']
234
- self.rm_other3 = data['RM_OTHER3']
235
- end
236
- end