dm-aspects 0.0.6 → 0.1.0

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: 3b6103b0acdd6c92852a3259807de6f54e09638c
4
- data.tar.gz: 8a31f580db56e225719676673a74dd7ac6d19890
3
+ metadata.gz: e25821f2599a2ecebeb70601afe52cdf4c52bedc
4
+ data.tar.gz: 6a8d144c617ca551680801f71882a28a874c38a5
5
5
  SHA512:
6
- metadata.gz: badcaa42790a58ef783f757c4fd3410cc4551eae7f449ca227a68ea7a2ec997f1373952140a71d253366c7717e0f2c0408d7e83fd4b1116fd6deac9ac2e1f54e
7
- data.tar.gz: 308e21e0fbe0927393d382de3518726bc668692471100560495d899612f0b2a4bcf5bc642b737199a3a4819169a3508eec55a01446af781daf82207253643965
6
+ metadata.gz: 53c1705882d2bf13871d862924b850efb199238c9a31b4629f1bac466d2cfa2d3dc4c08b110888f0de157d6607d98fefd359234b6c4ab99dab2357b46f95b111
7
+ data.tar.gz: eb90f482ca7ac5722cd849bc32111eef05b9cda42fa11a14740b178d18507607c0277b50f3325526a2e8d359778e8a94dd6a899b4e2cde7fdaa9d7d52aee7a17
@@ -15,11 +15,12 @@ module DataMapper
15
15
  module BSONID
16
16
  def self.included(base)
17
17
  # Public: Provides the default aspect's attributes.
18
+ base.property :id, String, length: 24, key: true, default: BSON::ObjectId.new.to_s
18
19
  base.property :id, String,
19
20
  length: 24,
20
21
  key: true,
21
22
  unique: true,
22
- default: proc { Moped::BSON::ObjectId.new.to_s }
23
+ default: proc { BSON::ObjectId.new.to_s }
23
24
 
24
25
  # Internal: Validates that the BSON ID is a valid object id.
25
26
  base.validates_with_method :id, method: :id_is_valid?
@@ -33,7 +34,7 @@ module DataMapper
33
34
  #
34
35
  # Returns the generation time of the BSON Object ID as a String.
35
36
  def id_generation_time
36
- Moped::BSON::ObjectId.from_string(@id).generation_time
37
+ BSON::ObjectId.from_string(@id).generation_time
37
38
  end
38
39
 
39
40
  # Public: Checks if the ID is a valid BSON Object ID.
@@ -45,7 +46,7 @@ module DataMapper
45
46
  #
46
47
  # Returns true if ID is valid, false if not.
47
48
  def id_is_valid?
48
- if Moped::BSON::ObjectId.legal?(@id)
49
+ if BSON::ObjectId.legal?(@id)
49
50
  true
50
51
  else
51
52
  [false, 'Id must be a valid BSON ObjectId']
@@ -1,5 +1,5 @@
1
1
  module DataMapper
2
2
  module Aspects
3
- VERSION = "0.0.6"
3
+ VERSION = "0.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dm-aspects
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - StyleSeek Engineering Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-10 00:00:00.000000000 Z
11
+ date: 2014-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dm-core