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 +1 -1
- data/active_record_to_simpledb.gemspec +1 -1
- data/lib/active_record_to_simpledb.rb +2 -0
- data/spec/active_record_setup.rb +13 -1
- data/spec/active_record_to_simpledb_spec.rb +7 -12
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
@@ -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)
|
data/spec/active_record_setup.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
RAILS_ENV = "
|
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
|