leads_to_highrise 0.2.12 → 0.2.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- M2MxM2E2YWE4NmE1YjdiNzk3YmY2OWI5ODQzMTI5Mjg1NWI1ZTc4ZA==
4
+ ZmFkMGY1OGIzMmVkN2NjNjQ4YWIxMzM1YWVmMzk1NDFmYzNmM2ZiYw==
5
5
  data.tar.gz: !binary |-
6
- YmNkZTU2M2IwNDg4NDk0ZmUxMDgyZmYwMDdlNDM3M2FlYmIzYjYxZA==
6
+ M2ExMzUxMTQyZDk4MzdlNjAyNjk5ZjllZTFmMDljYmJkMGNhNGMwMw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ODI3MGRhNzFkMGUzODgxMzFmYTAxZDA0MjljZGFmZTM3OGFhODVhYzgyMDM1
10
- ZWVkODViMzg3NDc1MWJhNDkyMWFhNWVkOTUwZTE3YTgzYTY3Y2Q1NjhiMmRh
11
- YjBlYmFiYmRjNDg0NWFmYWFiZjZkYTRmMjgyN2Y5M2EzZTJlM2E=
9
+ NTE1MjQ2Y2MzYTlhYWI4NmFkMWQ0NDk1NmJhOTkwYjdmZThiYzFmYzg1NTEz
10
+ ODg1NmY0ZTZmZWY3ZDdhZjhhYzY0ODE4MWEwYWQ5NmMxMzc0MTFkY2UzOTFm
11
+ N2FjNzNmMDdiZmNmNThiYjFiOGUyMDI5ZTBmOGZjNmY4YzBmMzk=
12
12
  data.tar.gz: !binary |-
13
- MGU4MzFiZGUwOTc3YmU5ZTU2ODY4Yzc3YTlhMTZhNWU0YjM4MDM1OTM5ZmNl
14
- NmI0MjJjNTNkM2ViZTY2OTg0ODk1ZDMzZWVkMDYxYWRkZTQyZmQ5MTg0OWMy
15
- NzE1ZDEwZjhlZjI0ZDhlYWQ4YjEwNjAyMTc4ZmFlY2U2MGY0MTg=
13
+ MzU3YWMwYTYwY2QyM2MxOWIyZmM2NDZlYTk3NzAwMjgwNTk0OTk5ZmZkNmNj
14
+ ZGI0ZGJlZDY3MDJmMjI5YzY1OWE5N2EyNjAxZDhlOWQxYWYxMGI3NzU0MTI4
15
+ ODYyZDIzZWFlZGRhYTliMTM1ZjExY2E3NmM1MmRjODgzMWM3YTE=
@@ -48,24 +48,28 @@ class LeadsController < ApplicationController
48
48
 
49
49
  def to_highrise
50
50
  @lead = Lead.find(params[:id])
51
- Highrise::Base.site = current_user.highrise_site
52
- Highrise::Base.user = current_user.highrise_user
53
- Highrise::Base.format = :xml
54
- p = Highrise::Person.new( first_name: @lead[:name],
55
- last_name: @lead[:last_name],
56
- title: @lead[:job_title],
57
- company_name: @lead[:company],
58
- contact_data: { email_addresses: [ { address: @lead[:emial], location: 'Work'} ],
59
- phone: @lead[:phone],
60
- website: @lead[:website] })
61
-
62
- #p = Highrise::Person.new(first_name: @lead[:name], contact_data: { email_addresses: [ { address: 'test@example.com', location: 'Work' } ] })
63
-
64
- #p.save
65
- if p.save
66
- redirect_to root_path, notice: 'The contact has been sended to highrise'
51
+ if current_user.highrise_site != nil || current_user.highrise_user !=
52
+ Highrise::Base.site = current_user.highrise_site
53
+ Highrise::Base.user = current_user.highrise_user
54
+ Highrise::Base.format = :xml
55
+ p = Highrise::Person.new( first_name: @lead[:name],
56
+ last_name: @lead[:last_name],
57
+ title: @lead[:job_title],
58
+ company_name: @lead[:company],
59
+ contact_data: { email_addresses: [ { address: @lead[:emial], location: 'Work'} ],
60
+ phone: @lead[:phone],
61
+ website: @lead[:website] })
62
+
63
+ #p = Highrise::Person.new(first_name: @lead[:name], contact_data: { email_addresses: [ { address: 'test@example.com', location: 'Work' } ] })
64
+
65
+ #p.save
66
+ if p.save
67
+ redirect_to root_path, notice: 'The contact has been sended to highrise'
68
+ else
69
+ redirect_to root_path, notice: 'Error.'
70
+ end
67
71
  else
68
- redirect_to root_path, notice: 'error.'
72
+ redirect_to root_path, notice: 'Please add your highrise settings'
69
73
  end
70
74
  end
71
75
 
@@ -1,3 +1,3 @@
1
1
  module LeadsToHighrise
2
- VERSION = "0.2.12"
2
+ VERSION = "0.2.13"
3
3
  end
@@ -2019,3 +2019,27 @@ Started GET "/assets/application.css?body=1" for 10.0.2.2 at 2014-04-17 11:10:29
2019
2019
 
2020
2020
 
2021
2021
  Started GET "/assets/application.js?body=1" for 10.0.2.2 at 2014-04-17 11:10:30 +0000
2022
+
2023
+
2024
+ Started GET "/leads/1/to_highrise" for 10.0.2.2 at 2014-04-17 11:22:07 +0000
2025
+ ActiveRecord::SchemaMigration Load (5.8ms) SELECT "schema_migrations".* FROM "schema_migrations"
2026
+ Processing by LeadsController#to_highrise as HTML
2027
+ Parameters: {"id"=>"1"}
2028
+ Lead Load (40.2ms) SELECT "leads".* FROM "leads" WHERE "leads"."id" = ? LIMIT 1 [["id", 1]]
2029
+ User Load (9.7ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
2030
+ Redirected to http://localhost:3000/
2031
+ Completed 302 Found in 6862ms (ActiveRecord: 103.7ms)
2032
+
2033
+
2034
+ Started GET "/" for 10.0.2.2 at 2014-04-17 11:22:18 +0000
2035
+ Processing by LeadsController#index as HTML
2036
+ Lead Load (8.7ms) SELECT "leads".* FROM "leads"
2037
+ User Load (25.7ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
2038
+ Rendered /vagrant/engine/leads_to_highrise/app/views/leads/index.html.erb within layouts/application (358.7ms)
2039
+ Completed 200 OK in 1670ms (Views: 1634.7ms | ActiveRecord: 34.4ms)
2040
+
2041
+
2042
+ Started GET "/assets/application.css?body=1" for 10.0.2.2 at 2014-04-17 11:22:21 +0000
2043
+
2044
+
2045
+ Started GET "/assets/application.js?body=1" for 10.0.2.2 at 2014-04-17 11:22:21 +0000
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leads_to_highrise
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.12
4
+ version: 0.2.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bruno Tripoloni