activerecord-activesalesforce-adapter 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. data/README +51 -0
  2. data/lib/active_record/connection_adapters/activesalesforce.rb +36 -0
  3. data/lib/active_record/connection_adapters/activesalesforce_adapter.rb +777 -0
  4. data/lib/active_record/connection_adapters/asf_active_record.rb +40 -0
  5. data/lib/active_record/connection_adapters/boxcar_command.rb +66 -0
  6. data/lib/active_record/connection_adapters/column_definition.rb +95 -0
  7. data/lib/active_record/connection_adapters/entity_definition.rb +59 -0
  8. data/lib/active_record/connection_adapters/id_resolver.rb +84 -0
  9. data/lib/active_record/connection_adapters/recording_binding.rb +90 -0
  10. data/lib/active_record/connection_adapters/relationship_definition.rb +81 -0
  11. data/lib/active_record/connection_adapters/result_array.rb +31 -0
  12. data/lib/active_record/connection_adapters/rforce.rb +361 -0
  13. data/lib/active_record/connection_adapters/sid_authentication_filter.rb +57 -0
  14. data/test/unit/basic_test.rb +203 -0
  15. data/test/unit/config.yml +5 -0
  16. data/test/unit/recorded_results/AsfUnitTestsBasicTest.test_add_notes_to_contact.recording +1966 -0
  17. data/test/unit/recorded_results/AsfUnitTestsBasicTest.test_assignment_rule_id.recording +1621 -0
  18. data/test/unit/recorded_results/AsfUnitTestsBasicTest.test_batch_insert.recording +1611 -0
  19. data/test/unit/recorded_results/AsfUnitTestsBasicTest.test_client_id.recording +1618 -0
  20. data/test/unit/recorded_results/AsfUnitTestsBasicTest.test_count_contacts.recording +1620 -0
  21. data/test/unit/recorded_results/AsfUnitTestsBasicTest.test_create_a_contact.recording +1611 -0
  22. data/test/unit/recorded_results/AsfUnitTestsBasicTest.test_find_a_contact.recording +1611 -0
  23. data/test/unit/recorded_results/AsfUnitTestsBasicTest.test_find_a_contact_by_first_name.recording +3468 -0
  24. data/test/unit/recorded_results/AsfUnitTestsBasicTest.test_find_a_contact_by_id.recording +1664 -0
  25. data/test/unit/recorded_results/AsfUnitTestsBasicTest.test_find_addresses.recording +1635 -0
  26. data/test/unit/recorded_results/AsfUnitTestsBasicTest.test_get_created_by_from_contact.recording +4307 -0
  27. data/test/unit/recorded_results/AsfUnitTestsBasicTest.test_master_detail.recording +1951 -0
  28. data/test/unit/recorded_results/AsfUnitTestsBasicTest.test_read_all_content_columns.recording +1611 -0
  29. data/test/unit/recorded_results/AsfUnitTestsBasicTest.test_save_a_contact.recording +1611 -0
  30. data/test/unit/recorded_results/AsfUnitTestsBasicTest.test_use_default_rule.recording +1618 -0
  31. data/test/unit/recorded_results/AsfUnitTestsBasicTest.test_use_update_mru.recording +1618 -0
  32. data/test/unit/recorded_test_case.rb +83 -0
  33. metadata +105 -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,105 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: activerecord-activesalesforce-adapter
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Doug Chasman
8
+ autorequire: activerecord-activesalesforce-adapter
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-01-01 00:00:00 -05:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rails
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 2.0.2
23
+ version:
24
+ - !ruby/object:Gem::Dependency
25
+ name: builder
26
+ version_requirement:
27
+ version_requirements: !ruby/object:Gem::Requirement
28
+ requirements:
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ version: 1.2.4
32
+ version:
33
+ description:
34
+ email: dchasman@salesforce.com
35
+ executables: []
36
+
37
+ extensions: []
38
+
39
+ extra_rdoc_files:
40
+ - README
41
+ files:
42
+ - lib/active_record
43
+ - lib/active_record/connection_adapters
44
+ - lib/active_record/connection_adapters/rforce.rb
45
+ - lib/active_record/connection_adapters/relationship_definition.rb
46
+ - lib/active_record/connection_adapters/result_array.rb
47
+ - lib/active_record/connection_adapters/activesalesforce_adapter.rb
48
+ - lib/active_record/connection_adapters/asf_active_record.rb
49
+ - lib/active_record/connection_adapters/column_definition.rb
50
+ - lib/active_record/connection_adapters/id_resolver.rb
51
+ - lib/active_record/connection_adapters/sid_authentication_filter.rb
52
+ - lib/active_record/connection_adapters/entity_definition.rb
53
+ - lib/active_record/connection_adapters/activesalesforce.rb
54
+ - lib/active_record/connection_adapters/boxcar_command.rb
55
+ - lib/active_record/connection_adapters/recording_binding.rb
56
+ - test/unit
57
+ - test/unit/config.yml
58
+ - test/unit/recorded_test_case.rb
59
+ - test/unit/basic_test.rb
60
+ - test/unit/recorded_results
61
+ - test/unit/recorded_results/AsfUnitTestsBasicTest.test_batch_insert.recording
62
+ - test/unit/recorded_results/AsfUnitTestsBasicTest.test_read_all_content_columns.recording
63
+ - test/unit/recorded_results/AsfUnitTestsBasicTest.test_find_a_contact_by_id.recording
64
+ - test/unit/recorded_results/AsfUnitTestsBasicTest.test_create_a_contact.recording
65
+ - test/unit/recorded_results/AsfUnitTestsBasicTest.test_count_contacts.recording
66
+ - test/unit/recorded_results/AsfUnitTestsBasicTest.test_get_created_by_from_contact.recording
67
+ - test/unit/recorded_results/AsfUnitTestsBasicTest.test_use_default_rule.recording
68
+ - test/unit/recorded_results/AsfUnitTestsBasicTest.test_assignment_rule_id.recording
69
+ - test/unit/recorded_results/AsfUnitTestsBasicTest.test_client_id.recording
70
+ - test/unit/recorded_results/AsfUnitTestsBasicTest.test_use_update_mru.recording
71
+ - test/unit/recorded_results/AsfUnitTestsBasicTest.test_master_detail.recording
72
+ - test/unit/recorded_results/AsfUnitTestsBasicTest.test_add_notes_to_contact.recording
73
+ - test/unit/recorded_results/AsfUnitTestsBasicTest.test_find_addresses.recording
74
+ - test/unit/recorded_results/AsfUnitTestsBasicTest.test_save_a_contact.recording
75
+ - test/unit/recorded_results/AsfUnitTestsBasicTest.test_find_a_contact.recording
76
+ - test/unit/recorded_results/AsfUnitTestsBasicTest.test_find_a_contact_by_first_name.recording
77
+ - README
78
+ has_rdoc: false
79
+ homepage: http://rubyforge.org/projects/activesfdc/
80
+ post_install_message:
81
+ rdoc_options: []
82
+
83
+ require_paths:
84
+ - lib
85
+ required_ruby_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: "0"
90
+ version:
91
+ required_rubygems_version: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: "0"
96
+ version:
97
+ requirements: []
98
+
99
+ rubyforge_project:
100
+ rubygems_version: 1.0.1
101
+ signing_key:
102
+ specification_version: 2
103
+ 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.
104
+ test_files: []
105
+