activeuuid 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.mkd CHANGED
@@ -89,15 +89,16 @@ application the keys are represented by a UUIDTools::UUID object.
89
89
 
90
90
  ## Benefits of UUIDs as primary key
91
91
 
92
- * allows multi-master write
92
+ * no id conflict during multi-master write
93
93
  * no locking due to auto-increment
94
94
  * with time-based UUIDs you can store a timestamp within your UUID
95
- * you can create natural keys
95
+ * you can create natural keys (based on the SHA of model attributes)
96
96
 
97
97
  ## Future work
98
98
  * more transparent support for natural and composite keys
99
99
  * support for MySQLs `INSERT ... ON DUPLICATE KEY UPDATE` syntax
100
100
  * support a primary column name other than `id`
101
+ * work on other databases (Postgres, etc)
101
102
  * tests
102
103
 
103
104
  ## Inspiration
@@ -105,6 +106,14 @@ James Golick's `friendly` is a great gem for NoSQL on MySQL. It's
105
106
  a great gateway drug to systems like Cassandra for teams that are
106
107
  already familiar with the ins-and-outs of MySQL.
107
108
 
109
+ ## Installation
110
+
111
+ Add this to your `Gemfile`
112
+
113
+ gem "activeuuid"
114
+
115
+ Or get the code here: https://github.com/jashmenn/activeuuid
116
+
108
117
  ## References
109
118
  * [1] http://bret.appspot.com/entry/how-friendfeed-uses-mysql
110
119
  * [2] http://kekoav.com/blog/36-computers/58-uuids-as-primary-keys-in-mysql.html
@@ -8,6 +8,16 @@ module UUIDTools
8
8
  end
9
9
  end
10
10
 
11
+ module Arel
12
+ module Visitors
13
+ class MySQL < Arel::Visitors::ToSql
14
+ def visit_UUIDTools_UUID(o)
15
+ o.quoted_id
16
+ end
17
+ end
18
+ end
19
+ end
20
+
11
21
  module ActiveUUID
12
22
  class UUIDSerializer
13
23
  def load(binary)
@@ -1,3 +1,3 @@
1
1
  module Activeuuid
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeuuid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-08-29 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: uuidtools
16
- requirement: &2156096440 !ruby/object:Gem::Requirement
16
+ requirement: &2153469320 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2156096440
24
+ version_requirements: *2153469320
25
25
  description: Add's binary (not string) UUIDs to ActiveRecord in MySQL
26
26
  email:
27
27
  - nate@natemurray.com