dynamoid 1.3.2 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 483c6653898e4eee69d97f7bc59531c15fcebc9a
4
- data.tar.gz: ef1a31b3fbad480de6bb782a818067bb8daff5d8
3
+ metadata.gz: decc1a7abee20de61693c51cdc89d39dc5a37340
4
+ data.tar.gz: 33dc108ac41878f619092ca53b3e0865b73aa775
5
5
  SHA512:
6
- metadata.gz: 68c24b5f84bf8afd6375f2637a6395aa1d222bcfbf1e8669bb29b864114ece17c5f3bc3d8a4fc92b3548276fd234f94dcdd64ab96bc694bf24449417c2069f8f
7
- data.tar.gz: dbcaf6a31a6ee2a50cf658a07287b7e037698dd39898d792832c3c0587fba1167525f61373d857b069f28414e543f8c3f547cf3dde9796787f2a8df6cb8c302c
6
+ metadata.gz: 21b9a070f8cb22b2c0fb21803e57fca01647c4b0091b98a08f00e84939fe20ed565e3703f78dbd726a62b203da8a36dfa2ded2274186aae43846513b5a64f092
7
+ data.tar.gz: acf6e06bc0df07455152b26af7830d57cf3b9a13cb670fbe68d3a88de3097cd47fd86e10864dfc6101617d8e0afb65e05e4487c1b3ab1aff6c349a4c4e2d3fcf
@@ -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.
@@ -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(MODELS, "*.rb") ].sort.each { |file| require file }
11
- tables = Dynamoid::Tasks::Database.create_tables
12
- result = tables[:created].map{ |c| "#{c} created" } + tables[:existing].map{ |e| "#{e} already exists" }
13
- result.sort.each{ |r| puts r }
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'
@@ -1,3 +1,3 @@
1
1
  module Dynamoid
2
- VERSION = "1.3.2"
2
+ VERSION = "1.3.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynamoid
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Symonds