saasable 5.0.2 → 5.0.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: fbdd5bd664a7dee9c2faf590b2f348edc7496cbc
4
- data.tar.gz: 75f3432b4e3fd0e166f61b68de4c37956d96b45a
3
+ metadata.gz: 566ee6acf6b10b3385bbcb6436629f737044c730
4
+ data.tar.gz: ee38076d303e5e698572a60577283a63c3dcc84a
5
5
  SHA512:
6
- metadata.gz: 8b6077c9c3829634e68351642a558d4ce26af4033b028433931fd5c65d9e58957009fe5297d25c6e7a49af984c6bb7c6f17f63e0f405e739a1cec3a7c8a01ba0
7
- data.tar.gz: daf169eb5d21dd86a89a4be93e23ebfa772280cda519f54709d8c74f11bad48aefc5d3fffae8af570e768ad732b64834ce4166e26a4f4c3833fecad13bcf0e9a
6
+ metadata.gz: c1c5f9793305d6d7f67f5ef98d4fe77760facf44cb50929cd439b0f3de294a7209072e5d39ee13246e019d13929b6b3cd8c6db3d8b60a7655b914175d2699585
7
+ data.tar.gz: d9a091a8a403622767f057ea80b6b566f2e72707bd3c6be9fec8b519391ab343c965fdcd1f788257c3c9368930e78832381901627ba847f08e7acba1513aeca4
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.2
1
+ ruby-2.3
data/Gemfile.lock CHANGED
@@ -1,36 +1,34 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- activemodel (4.2.5)
5
- activesupport (= 4.2.5)
4
+ activemodel (4.2.7.1)
5
+ activesupport (= 4.2.7.1)
6
6
  builder (~> 3.1)
7
- activesupport (4.2.5)
7
+ activesupport (4.2.7.1)
8
8
  i18n (~> 0.7)
9
9
  json (~> 1.7, >= 1.7.7)
10
10
  minitest (~> 5.1)
11
11
  thread_safe (~> 0.3, >= 0.3.4)
12
12
  tzinfo (~> 1.1)
13
- addressable (2.3.8)
14
- bson (3.2.6)
13
+ addressable (2.4.0)
14
+ bson (4.1.1)
15
15
  builder (3.2.2)
16
16
  descendants_tracker (0.0.4)
17
17
  thread_safe (~> 0.3, >= 0.3.1)
18
18
  diff-lcs (1.2.5)
19
19
  faraday (0.9.2)
20
20
  multipart-post (>= 1.2, < 3)
21
- git (1.2.9.1)
22
- github_api (0.13.0)
23
- addressable (~> 2.3)
21
+ git (1.3.0)
22
+ github_api (0.14.5)
23
+ addressable (~> 2.4.0)
24
24
  descendants_tracker (~> 0.0.4)
25
25
  faraday (~> 0.8, < 0.10)
26
26
  hashie (>= 3.4)
27
- multi_json (>= 1.7.5, < 2.0)
28
- nokogiri (~> 1.6.6)
29
- oauth2
30
- hashie (3.4.3)
27
+ oauth2 (~> 1.0)
28
+ hashie (3.4.4)
31
29
  highline (1.7.8)
32
30
  i18n (0.7.0)
33
- jeweler (2.0.1)
31
+ jeweler (2.1.1)
34
32
  builder
35
33
  bundler (>= 1.0)
36
34
  git (>= 1.2.5)
@@ -39,45 +37,50 @@ GEM
39
37
  nokogiri (>= 1.5.10)
40
38
  rake
41
39
  rdoc
40
+ semver
42
41
  json (1.8.3)
43
- jwt (1.5.2)
44
- mini_portile (0.6.2)
45
- minitest (5.8.3)
46
- mongo (2.1.2)
47
- bson (~> 3.0)
48
- mongoid (5.0.1)
42
+ jwt (1.5.4)
43
+ mini_portile2 (2.1.0)
44
+ minitest (5.9.0)
45
+ mongo (2.3.0)
46
+ bson (~> 4.1)
47
+ mongoid (5.1.4)
49
48
  activemodel (~> 4.0)
50
49
  mongo (~> 2.1)
51
- origin (~> 2.1)
50
+ origin (~> 2.2)
52
51
  tzinfo (>= 0.3.37)
53
- multi_json (1.11.2)
52
+ multi_json (1.12.1)
54
53
  multi_xml (0.5.5)
55
54
  multipart-post (2.0.0)
56
- nokogiri (1.6.6.4)
57
- mini_portile (~> 0.6.0)
58
- oauth2 (1.0.0)
55
+ nokogiri (1.6.8)
56
+ mini_portile2 (~> 2.1.0)
57
+ pkg-config (~> 1.1.7)
58
+ oauth2 (1.2.0)
59
59
  faraday (>= 0.8, < 0.10)
60
60
  jwt (~> 1.0)
61
61
  multi_json (~> 1.3)
62
62
  multi_xml (~> 0.5)
63
- rack (~> 1.2)
64
- origin (2.1.1)
65
- rack (1.6.4)
66
- rake (10.4.2)
67
- rdoc (4.2.0)
68
- rspec (3.4.0)
69
- rspec-core (~> 3.4.0)
70
- rspec-expectations (~> 3.4.0)
71
- rspec-mocks (~> 3.4.0)
72
- rspec-core (3.4.1)
73
- rspec-support (~> 3.4.0)
74
- rspec-expectations (3.4.0)
63
+ rack (>= 1.2, < 3)
64
+ origin (2.2.0)
65
+ pkg-config (1.1.7)
66
+ rack (2.0.1)
67
+ rake (11.2.2)
68
+ rdoc (4.2.2)
69
+ json (~> 1.4)
70
+ rspec (3.5.0)
71
+ rspec-core (~> 3.5.0)
72
+ rspec-expectations (~> 3.5.0)
73
+ rspec-mocks (~> 3.5.0)
74
+ rspec-core (3.5.2)
75
+ rspec-support (~> 3.5.0)
76
+ rspec-expectations (3.5.0)
75
77
  diff-lcs (>= 1.2.0, < 2.0)
76
- rspec-support (~> 3.4.0)
77
- rspec-mocks (3.4.0)
78
+ rspec-support (~> 3.5.0)
79
+ rspec-mocks (3.5.0)
78
80
  diff-lcs (>= 1.2.0, < 2.0)
79
- rspec-support (~> 3.4.0)
80
- rspec-support (3.4.1)
81
+ rspec-support (~> 3.5.0)
82
+ rspec-support (3.5.0)
83
+ semver (1.0.1)
81
84
  thread_safe (0.3.5)
82
85
  tzinfo (1.2.2)
83
86
  thread_safe (~> 0.1)
@@ -93,4 +96,4 @@ DEPENDENCIES
93
96
  rspec
94
97
 
95
98
  BUNDLED WITH
96
- 1.10.6
99
+ 1.12.5
data/VERSION CHANGED
@@ -1 +1 @@
1
- 5.0.2
1
+ 5.0.3
@@ -1,7 +1,5 @@
1
1
  module Saasable::Errors
2
2
  class MultipleSaasDocuments < StandardError; end
3
3
  class NoSaasDocuments < StandardError; end
4
-
5
- class MultipleSaasFound < StandardError; end
6
4
  class SaasNotFound < StandardError; end
7
5
  end
@@ -18,7 +18,7 @@ module Saasable::Mongoid::SaasDocument
18
18
  validates_uniqueness_of :hosts
19
19
 
20
20
  # Indexes
21
- index({hosts: 1})
21
+ index({hosts: 1}, unique: true)
22
22
  end
23
23
 
24
24
  klass.instance_variable_set("@_after_activate_chain", [])
@@ -55,13 +55,11 @@ module Saasable::Mongoid::SaasDocument
55
55
  raise Saasable::Errors::NoSaasDocuments, "you need to set one Saasable::SaasDocument"
56
56
  end
57
57
 
58
- possible_saas = Saasable::Mongoid::SaasDocument.saas_document.where(hosts: a_host).to_a
59
- if possible_saas.empty?
58
+ possible_saas = Saasable::Mongoid::SaasDocument.saas_document.where(hosts: a_host).first
59
+ if possible_saas.nil?
60
60
  raise Saasable::Errors::SaasNotFound, "no #{Saasable::Mongoid::SaasDocument.saas_document.name} found for the host: \"#{a_host}\""
61
- elsif possible_saas.count > 1
62
- raise Saasable::Errors::MultipleSaasFound, "more then 1 #{Saasable::Mongoid::SaasDocument.saas_document.name} found for the host: \"#{a_host}\""
63
61
  else
64
- return possible_saas.first
62
+ return possible_saas
65
63
  end
66
64
  end
67
65
 
@@ -10,7 +10,7 @@ module Saasable::Mongoid::ScopedDocument
10
10
 
11
11
  # Indexes
12
12
  index({saas_id: 1})
13
- index({saad_id: 1, _id: 1})
13
+ index({saad_id: 1, _id: 1}, unique: true)
14
14
 
15
15
  class << self
16
16
  alias_method_chain :index, :saasable
@@ -36,8 +36,7 @@ module Saasable::Mongoid::ScopedDocument
36
36
  end
37
37
 
38
38
  def index_with_saasable(spec, options = {})
39
- index_without_saasable(spec, options.merge({unique: false}))
40
- index_without_saasable({saas_id: 1}.merge(spec), options) unless spec.include?(:saas_id)
39
+ index_without_saasable({saas_id: 1}.merge(spec), options)
41
40
  end
42
41
  end
43
42
  end
data/saasable.gemspec CHANGED
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: saasable 5.0.2 ruby lib
5
+ # stub: saasable 5.0.3 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "saasable"
9
- s.version = "5.0.2"
9
+ s.version = "5.0.3"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Educa2", "Rafael Gaspar"]
14
- s.date = "2016-02-01"
14
+ s.date = "2016-08-17"
15
15
  s.description = "A gem for making a Multi-Tenant SaaS using Mongoid"
16
16
  s.email = "suporte@educa2.com.br"
17
17
  s.extra_rdoc_files = [
@@ -44,7 +44,7 @@ Gem::Specification.new do |s|
44
44
  ]
45
45
  s.homepage = "http://github.com/educa2/saasable"
46
46
  s.licenses = ["MIT"]
47
- s.rubygems_version = "2.4.8"
47
+ s.rubygems_version = "2.5.1"
48
48
  s.summary = "A gem for making a Multi-Tenant SaaS using Mongoid"
49
49
 
50
50
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saasable
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.2
4
+ version: 5.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Educa2
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-02-01 00:00:00.000000000 Z
12
+ date: 2016-08-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mongoid
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
131
  version: '0'
132
132
  requirements: []
133
133
  rubyforge_project:
134
- rubygems_version: 2.4.8
134
+ rubygems_version: 2.5.1
135
135
  signing_key:
136
136
  specification_version: 4
137
137
  summary: A gem for making a Multi-Tenant SaaS using Mongoid