active_record_to_simpledb 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.3.0
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{active_record_to_simpledb}
8
- s.version = "0.2.0"
8
+ s.version = "0.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ivan Acosta-Rubio"]
@@ -101,6 +101,8 @@ class ActiveRecordToSimpledb
101
101
  #
102
102
  def send_object_to_simpledb
103
103
  if RAILS_ENV == "test"
104
+ # we do nothing in the test env because we don't want to polute other people tests
105
+ elsif RAILS_ENV == "prueba"
104
106
  ActiveRecordToSimpledb::Client.create(domain_name, self.attributes)
105
107
  else
106
108
  Resque.enqueue(ActiveRecordToSimpledb::Resque::Create, self.attributes)
@@ -1,4 +1,4 @@
1
- RAILS_ENV = "test"
1
+ RAILS_ENV = "prueba"
2
2
 
3
3
  config = YAML::load(IO.read(File.dirname(__FILE__) + '/database.yml'))
4
4
  ActiveRecord::Base.logger = ActiveSupport::BufferedLogger.new(File.dirname(__FILE__) + "debug.log")
@@ -11,6 +11,18 @@ def rebuild_model options = {}
11
11
  end
12
12
  end
13
13
 
14
+
15
+
16
+ class Rails
17
+ def self.version
18
+ '2.1.2'
19
+ end
20
+
21
+ def self.root
22
+ Dir.pwd
23
+ end
24
+ end
25
+
14
26
  rebuild_model
15
27
 
16
28
 
@@ -6,18 +6,6 @@ class TicketSale < ActiveRecord::Base
6
6
  include ActiveRecordToSimpledb::Callbacks::Create
7
7
  end
8
8
 
9
-
10
- class Rails
11
-
12
- def self.version
13
- '2.1.2'
14
- end
15
-
16
- def self.root
17
- Dir.pwd
18
- end
19
- end
20
-
21
9
  describe ActiveRecordToSimpledb do
22
10
 
23
11
  context "conection" do
@@ -41,7 +29,14 @@ describe ActiveRecordToSimpledb do
41
29
  end
42
30
 
43
31
  it "uses resque to send the object" do
32
+ end
44
33
 
34
+ it "does nothing when rails env is test" do
35
+ RAILS_ENV = "test"
36
+ attr = {"id" => 4, "event_id" => 123, "title" => "Hello" }
37
+ TicketSale.create(attr)
38
+ t = ActiveRecordToSimpledb::Query.find("ticketsale", 4)
39
+ t[:attributes].should == {}
45
40
  end
46
41
 
47
42
  context "integration" do
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 2
7
+ - 3
8
8
  - 0
9
- version: 0.2.0
9
+ version: 0.3.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ivan Acosta-Rubio