entrance 0.4.6 → 0.4.7

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.
@@ -1,7 +1,7 @@
1
1
  module Entrance
2
2
  MAJOR = 0
3
3
  MINOR = 4
4
- PATCH = 6
4
+ PATCH = 7
5
5
 
6
6
  VERSION = [MAJOR, MINOR, PATCH].join('.')
7
7
  end
data/lib/entrance.rb CHANGED
@@ -12,7 +12,7 @@ module Entrance
12
12
  end
13
13
 
14
14
  def self.model
15
- @model ||= Kernel.const_get(config.model)
15
+ @model ||= get_class(config.model)
16
16
  end
17
17
 
18
18
  def self.fields
@@ -29,4 +29,10 @@ module Entrance
29
29
  str[0..(length-1)]
30
30
  end
31
31
 
32
+ private
33
+
34
+ def self.get_class(str)
35
+ str.split('::').inject(Object) { |mod, name| mod.const_get(name) }
36
+ end
37
+
32
38
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: entrance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-03-19 00:00:00.000000000 Z
12
+ date: 2015-03-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bcrypt