dynamoid 1.3.2 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/dynamoid/config.rb +1 -0
- data/lib/dynamoid/tasks/database.rake +8 -6
- data/lib/dynamoid/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: decc1a7abee20de61693c51cdc89d39dc5a37340
|
4
|
+
data.tar.gz: 33dc108ac41878f619092ca53b3e0865b73aa775
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21b9a070f8cb22b2c0fb21803e57fca01647c4b0091b98a08f00e84939fe20ed565e3703f78dbd726a62b203da8a36dfa2ded2274186aae43846513b5a64f092
|
7
|
+
data.tar.gz: acf6e06bc0df07455152b26af7830d57cf3b9a13cb670fbe68d3a88de3097cd47fd86e10864dfc6101617d8e0afb65e05e4487c1b3ab1aff6c349a4c4e2d3fcf
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# HEAD
|
2
2
|
|
3
|
+
# 1.3.3
|
4
|
+
|
5
|
+
* Allow configuration of the Dynamoid models directory, as not everyone keeps non AR models in app/models
|
6
|
+
- Dynamoid::Config.models_dir = "app/whatever"
|
7
|
+
|
3
8
|
# 1.3.2
|
4
9
|
|
5
10
|
* Fix migrations by stopping the loading of all rails models outside the rails env.
|
data/lib/dynamoid/config.rb
CHANGED
@@ -29,6 +29,7 @@ module Dynamoid
|
|
29
29
|
option :sync_retry_max_times, :default => 60 # a bit over 2 minutes
|
30
30
|
option :sync_retry_wait_seconds, :default => 2
|
31
31
|
option :convert_big_decimal, :default => false
|
32
|
+
option :models_dir, :default => "app/models" # perhaps you keep your dynamoid models in a different directory?
|
32
33
|
|
33
34
|
# The default logger for Dynamoid: either the Rails logger or just stdout.
|
34
35
|
#
|
@@ -1,16 +1,18 @@
|
|
1
1
|
require 'dynamoid'
|
2
2
|
require 'dynamoid/tasks/database'
|
3
3
|
|
4
|
-
MODELS ||= File.join(Rails.root, "app/models")
|
5
|
-
|
6
4
|
namespace :dynamoid do
|
7
5
|
desc "Creates DynamoDB tables, one for each of your Dynamoid models - does not modify pre-existing tables"
|
8
6
|
task :create_tables => :environment do
|
9
7
|
# Load models so Dynamoid will be able to discover tables expected.
|
10
|
-
Dir[ File.join(
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
Dir[ File.join(Dynamoid::Config.models_dir, "*.rb") ].sort.each { |file| require file }
|
9
|
+
if Dynamoid.included_models.any?
|
10
|
+
tables = Dynamoid::Tasks::Database.create_tables
|
11
|
+
result = tables[:created].map{ |c| "#{c} created" } + tables[:existing].map{ |e| "#{e} already exists" }
|
12
|
+
result.sort.each{ |r| puts r }
|
13
|
+
else
|
14
|
+
puts "Dynamoid models are not loaded, or you have no Dynamoid models."
|
15
|
+
end
|
14
16
|
end
|
15
17
|
|
16
18
|
desc 'Tests if the DynamoDB instance can be contacted using your configuration'
|
data/lib/dynamoid/version.rb
CHANGED