johnideal-activerecord-activesalesforce-adapter 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +51 -0
- data/lib/active_record/connection_adapters/activesalesforce.rb +36 -0
- data/lib/active_record/connection_adapters/activesalesforce_adapter.rb +779 -0
- data/lib/active_record/connection_adapters/asf_active_record.rb +40 -0
- data/lib/active_record/connection_adapters/boxcar_command.rb +66 -0
- data/lib/active_record/connection_adapters/column_definition.rb +95 -0
- data/lib/active_record/connection_adapters/entity_definition.rb +59 -0
- data/lib/active_record/connection_adapters/id_resolver.rb +84 -0
- data/lib/active_record/connection_adapters/recording_binding.rb +90 -0
- data/lib/active_record/connection_adapters/relationship_definition.rb +81 -0
- data/lib/active_record/connection_adapters/result_array.rb +31 -0
- data/lib/active_record/connection_adapters/rforce.rb +361 -0
- data/lib/active_record/connection_adapters/sid_authentication_filter.rb +57 -0
- data/test/unit/basic_test.rb +203 -0
- data/test/unit/config.yml +5 -0
- data/test/unit/recorded_results/AsfUnitTestsBasicTest.test_add_notes_to_contact.recording +1966 -0
- data/test/unit/recorded_results/AsfUnitTestsBasicTest.test_assignment_rule_id.recording +1621 -0
- data/test/unit/recorded_results/AsfUnitTestsBasicTest.test_batch_insert.recording +1611 -0
- data/test/unit/recorded_results/AsfUnitTestsBasicTest.test_client_id.recording +1618 -0
- data/test/unit/recorded_results/AsfUnitTestsBasicTest.test_count_contacts.recording +1620 -0
- data/test/unit/recorded_results/AsfUnitTestsBasicTest.test_create_a_contact.recording +1611 -0
- data/test/unit/recorded_results/AsfUnitTestsBasicTest.test_find_a_contact.recording +1611 -0
- data/test/unit/recorded_results/AsfUnitTestsBasicTest.test_find_a_contact_by_first_name.recording +3468 -0
- data/test/unit/recorded_results/AsfUnitTestsBasicTest.test_find_a_contact_by_id.recording +1664 -0
- data/test/unit/recorded_results/AsfUnitTestsBasicTest.test_find_addresses.recording +1635 -0
- data/test/unit/recorded_results/AsfUnitTestsBasicTest.test_get_created_by_from_contact.recording +4307 -0
- data/test/unit/recorded_results/AsfUnitTestsBasicTest.test_master_detail.recording +1951 -0
- data/test/unit/recorded_results/AsfUnitTestsBasicTest.test_read_all_content_columns.recording +1611 -0
- data/test/unit/recorded_results/AsfUnitTestsBasicTest.test_save_a_contact.recording +1611 -0
- data/test/unit/recorded_results/AsfUnitTestsBasicTest.test_use_default_rule.recording +1618 -0
- data/test/unit/recorded_results/AsfUnitTestsBasicTest.test_use_update_mru.recording +1618 -0
- data/test/unit/recorded_test_case.rb +83 -0
- metadata +107 -0
@@ -0,0 +1,83 @@
|
|
1
|
+
=begin
|
2
|
+
ActiveSalesforce
|
3
|
+
Copyright 2006 Doug Chasman
|
4
|
+
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
you may not use this file except in compliance with the License.
|
7
|
+
You may obtain a copy of the License at
|
8
|
+
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
See the License for the specific language governing permissions and
|
15
|
+
limitations under the License.
|
16
|
+
=end
|
17
|
+
|
18
|
+
|
19
|
+
require 'test/unit'
|
20
|
+
require 'set'
|
21
|
+
require 'pp'
|
22
|
+
|
23
|
+
|
24
|
+
module Asf
|
25
|
+
module UnitTests
|
26
|
+
|
27
|
+
module RecordedTestCase
|
28
|
+
LOGGER = Logger.new(STDOUT)
|
29
|
+
@@config = YAML.load_file(File.dirname(__FILE__) + '/config.yml').symbolize_keys
|
30
|
+
|
31
|
+
|
32
|
+
def recording?
|
33
|
+
@recording
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
def config
|
38
|
+
@@config
|
39
|
+
end
|
40
|
+
|
41
|
+
|
42
|
+
def initialize(test_method_name)
|
43
|
+
super(test_method_name)
|
44
|
+
|
45
|
+
@force_recording = Set.new
|
46
|
+
end
|
47
|
+
|
48
|
+
|
49
|
+
def force_recording(method)
|
50
|
+
@force_recording.add(method)
|
51
|
+
end
|
52
|
+
|
53
|
+
|
54
|
+
def unforce_recording(method)
|
55
|
+
@force_recording.delete(method)
|
56
|
+
end
|
57
|
+
|
58
|
+
|
59
|
+
def setup
|
60
|
+
@recording = (((not File.exists?(recording_file_name)) or config[:recording]) or @force_recording.include?(method_name.to_sym))
|
61
|
+
|
62
|
+
action = { :adapter => 'activesalesforce', :url => config[:url], :username => config[:username],
|
63
|
+
:password => config[:password], :recording_source => recording_file_name }
|
64
|
+
|
65
|
+
action[:recording] = true if @recording
|
66
|
+
|
67
|
+
ActiveRecord::Base.logger = LOGGER
|
68
|
+
ActiveRecord::Base.clear_active_connections!
|
69
|
+
ActiveRecord::Base.reset_column_information_and_inheritable_attributes_for_all_subclasses
|
70
|
+
ActiveRecord::Base.establish_connection(action)
|
71
|
+
|
72
|
+
@connection = ActiveRecord::Base.connection
|
73
|
+
end
|
74
|
+
|
75
|
+
|
76
|
+
def recording_file_name
|
77
|
+
File.dirname(__FILE__) + "/recorded_results/#{self.class.name.gsub('::', '')}.#{method_name}.recording"
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
83
|
+
end
|
metadata
ADDED
@@ -0,0 +1,107 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: johnideal-activerecord-activesalesforce-adapter
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Doug Chasman
|
8
|
+
- Luigi Montanez
|
9
|
+
- Senthil Nayagam
|
10
|
+
autorequire:
|
11
|
+
bindir: bin
|
12
|
+
cert_chain: []
|
13
|
+
|
14
|
+
date: 2008-08-09 00:00:00 -07:00
|
15
|
+
default_executable:
|
16
|
+
dependencies:
|
17
|
+
- !ruby/object:Gem::Dependency
|
18
|
+
name: rails
|
19
|
+
version_requirement:
|
20
|
+
version_requirements: !ruby/object:Gem::Requirement
|
21
|
+
requirements:
|
22
|
+
- - ">="
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: 2.0.2
|
25
|
+
version:
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: builder
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.2.4
|
34
|
+
version:
|
35
|
+
description:
|
36
|
+
email: dchasman@salesforce.com
|
37
|
+
executables: []
|
38
|
+
|
39
|
+
extensions: []
|
40
|
+
|
41
|
+
extra_rdoc_files:
|
42
|
+
- README
|
43
|
+
files:
|
44
|
+
- lib/active_record
|
45
|
+
- lib/active_record/connection_adapters
|
46
|
+
- lib/active_record/connection_adapters/rforce.rb
|
47
|
+
- lib/active_record/connection_adapters/relationship_definition.rb
|
48
|
+
- lib/active_record/connection_adapters/result_array.rb
|
49
|
+
- lib/active_record/connection_adapters/activesalesforce_adapter.rb
|
50
|
+
- lib/active_record/connection_adapters/asf_active_record.rb
|
51
|
+
- lib/active_record/connection_adapters/column_definition.rb
|
52
|
+
- lib/active_record/connection_adapters/id_resolver.rb
|
53
|
+
- lib/active_record/connection_adapters/sid_authentication_filter.rb
|
54
|
+
- lib/active_record/connection_adapters/entity_definition.rb
|
55
|
+
- lib/active_record/connection_adapters/activesalesforce.rb
|
56
|
+
- lib/active_record/connection_adapters/boxcar_command.rb
|
57
|
+
- lib/active_record/connection_adapters/recording_binding.rb
|
58
|
+
- test/unit
|
59
|
+
- test/unit/config.yml
|
60
|
+
- test/unit/recorded_test_case.rb
|
61
|
+
- test/unit/basic_test.rb
|
62
|
+
- test/unit/recorded_results
|
63
|
+
- test/unit/recorded_results/AsfUnitTestsBasicTest.test_batch_insert.recording
|
64
|
+
- test/unit/recorded_results/AsfUnitTestsBasicTest.test_read_all_content_columns.recording
|
65
|
+
- test/unit/recorded_results/AsfUnitTestsBasicTest.test_find_a_contact_by_id.recording
|
66
|
+
- test/unit/recorded_results/AsfUnitTestsBasicTest.test_create_a_contact.recording
|
67
|
+
- test/unit/recorded_results/AsfUnitTestsBasicTest.test_count_contacts.recording
|
68
|
+
- test/unit/recorded_results/AsfUnitTestsBasicTest.test_get_created_by_from_contact.recording
|
69
|
+
- test/unit/recorded_results/AsfUnitTestsBasicTest.test_use_default_rule.recording
|
70
|
+
- test/unit/recorded_results/AsfUnitTestsBasicTest.test_assignment_rule_id.recording
|
71
|
+
- test/unit/recorded_results/AsfUnitTestsBasicTest.test_client_id.recording
|
72
|
+
- test/unit/recorded_results/AsfUnitTestsBasicTest.test_use_update_mru.recording
|
73
|
+
- test/unit/recorded_results/AsfUnitTestsBasicTest.test_master_detail.recording
|
74
|
+
- test/unit/recorded_results/AsfUnitTestsBasicTest.test_add_notes_to_contact.recording
|
75
|
+
- test/unit/recorded_results/AsfUnitTestsBasicTest.test_find_addresses.recording
|
76
|
+
- test/unit/recorded_results/AsfUnitTestsBasicTest.test_save_a_contact.recording
|
77
|
+
- test/unit/recorded_results/AsfUnitTestsBasicTest.test_find_a_contact.recording
|
78
|
+
- test/unit/recorded_results/AsfUnitTestsBasicTest.test_find_a_contact_by_first_name.recording
|
79
|
+
- README
|
80
|
+
has_rdoc: false
|
81
|
+
homepage: http://activesfdc.rubyforge.org/
|
82
|
+
post_install_message: "this version is compatible with Rails 2.2,\n please report any bug in the group\n http://groups.google.com/group/activesalesforce\n "
|
83
|
+
rdoc_options: []
|
84
|
+
|
85
|
+
require_paths:
|
86
|
+
- lib
|
87
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: "0"
|
92
|
+
version:
|
93
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: "0"
|
98
|
+
version:
|
99
|
+
requirements: []
|
100
|
+
|
101
|
+
rubyforge_project: http://rubyforge.org/projects/activesfdc/
|
102
|
+
rubygems_version: 1.2.0
|
103
|
+
signing_key:
|
104
|
+
specification_version: 2
|
105
|
+
summary: ActiveSalesforce (ASF) is a Rails connection adapter that provides direct access to Salesforce.com hosted data and metadata via the ActiveRecord model layer. Objects, fields, and relationships are all auto surfaced as active record attributes and rels.
|
106
|
+
test_files: []
|
107
|
+
|