caboose-rets 0.0.6 → 0.0.7
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 +8 -8
- data/app/controllers/caboose_rets/agents_controller.rb +2 -2
- data/app/controllers/caboose_rets/open_houses_controller.rb +8 -51
- data/app/models/caboose_rets/open_house.rb +14 -0
- data/app/models/caboose_rets/rets_importer.rb +4 -1
- data/lib/caboose_rets/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZDVjYTg5ODIxYzFjNmJjYmFiYmU5ZTIyOTAzMTkzNDdiNzFhMzEyMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZmMxY2E4YjQ1YTU0YmI2YmIzZTkzMjVkZWUxNDI2ZjdmZWEyNWMzZA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
Y2I2ZDZlNmRiNTJjYzk1NzcwMjI2YTI1YjI5MTExYmNhYjdmMDViZDZlNjYx
|
10
|
+
ZDI2MDcxNjZhZTNmZTYzMjM4NDEzMDU2ZmZlMmQzNTc5Njk5NjliMGQ0NjY2
|
11
|
+
MDEyMDliMTFhYmFlMGM4NzM1Njc0YWI1YzdlYzVhZTg3Zjc5ZTQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZTgzZmY3ZjAwOTVmMjA2ODA1MDUzNjk5YjA3YmQxM2ZmMGE5M2NjYWI5ZmQw
|
14
|
+
MDE5Njg4YjBkZDE4ZDFiZWZiOWQyZmUxMWIxNDA2ZWU1OTk5ZDJmODM2OTQz
|
15
|
+
NjFjMjAzYzBhYWY4NjU5MjQ0YzY5MDk4OWU4ZGM4Y2EzYzY4ZjA=
|
@@ -4,8 +4,8 @@ module CabooseRets
|
|
4
4
|
|
5
5
|
# GET /agents
|
6
6
|
def index
|
7
|
-
@agents
|
8
|
-
@agent
|
7
|
+
@agents = Agent.where("lo_code = '46' AND hide IS false").order("last_name, first_name")
|
8
|
+
@agent = Agent.where(:la_code => '048540000').first
|
9
9
|
@assistants = Agent.where(:assistant_to => '048540000').order("last_name, first_name")
|
10
10
|
end
|
11
11
|
|
@@ -1,60 +1,17 @@
|
|
1
1
|
require "open-uri"
|
2
2
|
|
3
3
|
module CabooseRets
|
4
|
-
class OpenHousesController < ApplicationController
|
5
|
-
|
6
|
-
# GET /admin/open-houses/new
|
7
|
-
def admin_new
|
8
|
-
return if !user_is_allowed('post', 'new')
|
9
|
-
@post = Caboose::Post.new
|
10
|
-
render :layout => 'caboose/admin'
|
11
|
-
end
|
4
|
+
class OpenHousesController < ApplicationController
|
12
5
|
|
13
|
-
#
|
14
|
-
def
|
15
|
-
|
16
|
-
|
17
|
-
resp = Caboose::StdClass.new({
|
18
|
-
'error' => nil,
|
19
|
-
'redirect' => nil
|
20
|
-
})
|
21
|
-
|
22
|
-
mls = params[:mls]
|
23
|
-
post = post_from_mls(mls)
|
24
|
-
|
25
|
-
if post.nil?
|
26
|
-
resp.error = "No property with MLS id #{params[:mls]}."
|
27
|
-
else
|
28
|
-
post.published = false
|
29
|
-
post.save
|
30
|
-
resp.redirect = "/admin/posts/#{post.id}/edit"
|
31
|
-
end
|
32
|
-
|
33
|
-
render :json => resp
|
6
|
+
# get /open-houses
|
7
|
+
def index
|
8
|
+
@open_houses = OpenHouse.where("open_house_type = 'PUB' and open_house_date > '#{DateTime.now.strftime("%F")}'").reorder("open_house_date, start_time").all
|
34
9
|
end
|
35
10
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
prop = type.find(mls)
|
41
|
-
next if prop.nil?
|
42
|
-
ptype = ['residential', 'commercial', 'land'][i]
|
43
|
-
|
44
|
-
d = params[:date_time]
|
45
|
-
post = Caboose::Post.new
|
46
|
-
post.title = "Open House on #{d} at #{prop.street_num.to_s} #{prop.street_name.titleize}"
|
47
|
-
|
48
|
-
post.body = ""
|
49
|
-
post.body << "<p>#{prop.remarks}</p>" if prop.remarks and !prop.remarks.strip.empty?
|
50
|
-
post.body << "\n<p>Directions: #{prop.directions}</p>" if prop.directions and !prop.directions.strip.empty?
|
51
|
-
post.body << "\n<p><a href='/#{ptype}/#{prop.id}/details'>More details</a></p>"
|
52
|
-
|
53
|
-
post.image = open("https://s3.amazonaws.com/advantagerealtygroup.com/#{ptype}/#{mls}_1_original.jpg")
|
54
|
-
|
55
|
-
break
|
56
|
-
end
|
57
|
-
return post
|
11
|
+
# get /open-houses/:id
|
12
|
+
def details
|
13
|
+
@open_houses = OpenHouse.find(params[:id])
|
58
14
|
end
|
15
|
+
|
59
16
|
end
|
60
17
|
end
|
@@ -2,6 +2,20 @@
|
|
2
2
|
class CabooseRets::OpenHouse < ActiveRecord::Base
|
3
3
|
self.table_name = "rets_open_houses"
|
4
4
|
|
5
|
+
def property
|
6
|
+
models = [CabooseRets::ResidentialProperty, CabooseRets::CommercialProperty, CabooseRets::LandProperty, CabooseRets::MultiFamilyProperty]
|
7
|
+
models.each do |model|
|
8
|
+
id = self.mls_acct.to_i
|
9
|
+
return model.find(id) if model.exists?(id)
|
10
|
+
end
|
11
|
+
return nil
|
12
|
+
end
|
13
|
+
|
14
|
+
def agent
|
15
|
+
return CabooseRets::Agent.where(:la_code => self.la_code).first if CabooseRets::Agent.exists?(:la_code => self.la_code)
|
16
|
+
return nil
|
17
|
+
end
|
18
|
+
|
5
19
|
def parse(data)
|
6
20
|
self.id = data['ID']
|
7
21
|
self.comments = data['COMMENTS']
|
@@ -185,7 +185,10 @@ class CabooseRets::RetsImporter # < ActiveRecord::Base
|
|
185
185
|
end
|
186
186
|
return
|
187
187
|
end
|
188
|
-
|
188
|
+
self.download_agent_images(agent)
|
189
|
+
end
|
190
|
+
|
191
|
+
def self.download_agent_images(agent)
|
189
192
|
a = agent
|
190
193
|
self.log "Saving image for #{a.first_name} #{a.last_name}..."
|
191
194
|
begin
|
data/lib/caboose_rets/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caboose-rets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Barry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: caboose-cms
|