trax_model 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2c006d0d9afaebfa07ac07801d585a987e39292c
4
- data.tar.gz: f6e2b7f70e5d7db1d530dd0d8f9699459843fae6
3
+ metadata.gz: 3a86c5949b3cd7f7ac7767f1dbf1a5b19dbc34d5
4
+ data.tar.gz: 98c3b79365a9481776921ccda2fa84de42e79627
5
5
  SHA512:
6
- metadata.gz: 7522248edd39ccaceaab581f7c3440a3073b1af2840bc2305e7f7ca4f916d1efd296ba4986ac7ce29fa5bba06f9fb0e75e1c50f0c2a5db6533831be3f1a97b41
7
- data.tar.gz: f784118f67383dda766e1d95c2b1518046f4342a5584ab0d41ab289b4b2b4cbcb83db40a4fabb6fa711e3e0372d40da37623551d210b9af99530b998b6192b42
6
+ metadata.gz: 98dad576741bcaad00821fe586117bf9259ca23c39c198e06d9a2ecf86b523a48d5dbe9a904257947dd9e4207451205d658acbe745cdf4b7c3e68279c640a2ae
7
+ data.tar.gz: 6f9ead4ee3ce3e17909e53d88c560542300cf65896c265bb58f9e3112b0e0fc3a7014406eb88c039bd000995e2c050167f3b7da283f0c8bfa04003efdee536c8
@@ -12,19 +12,27 @@ module Trax
12
12
  }.freeze
13
13
 
14
14
  def uuid
15
- ::Trax::Model::UUID.new(super)
15
+ uuid_column = self.class.trax_defaults.uuid_column
16
+ uuid_value = (uuid_column == :uuid) ? super : __send__(uuid_column)
17
+
18
+ ::Trax::Model::UUID.new(uuid_value)
16
19
  end
17
20
 
18
- #i.e, Blog::Post will = post
21
+ #i.e. Blog::Post
19
22
  def uuid_type
20
- uuid.record_type.name.demodulize.underscore
23
+ uuid.record_type
21
24
  end
22
25
 
23
- #i.e. Blog::Post
24
- def uuid_type_full
26
+ #i.e. 'Blog::Post'
27
+ def uuid_type_name
25
28
  uuid.record_type.name
26
29
  end
27
30
 
31
+ #i.e, Blog::Post will = post
32
+ def uuid_type_slug
33
+ uuid.record_type.name.demodulize.underscore
34
+ end
35
+
28
36
  module ClassMethods
29
37
  delegate :uuid_prefix, :to => :trax_defaults
30
38
  delegate :uuid_column, :to => :trax_defaults
@@ -1,3 +1,3 @@
1
1
  module TraxModel
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trax_model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Ayre