pgcrypto 0.0.2 → 0.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.
- data/CHANGES +3 -0
- data/VERSION +1 -1
- data/lib/pgcrypto.rb +2 -1
- data/lib/pgcrypto/active_record.rb +2 -2
- data/pgcrypto.gemspec +4 -3
- metadata +1 -1
data/CHANGES
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.3
|
data/lib/pgcrypto.rb
CHANGED
@@ -27,6 +27,7 @@ module PGCrypto
|
|
27
27
|
unless columns_hash[encrypted_column_name]
|
28
28
|
puts "WARNING: You defined #{column_name} as an encrypted column, but you don't have a corresponding #{encrypted_column_name} column in your database!"
|
29
29
|
end
|
30
|
+
|
30
31
|
# Stash the encryption type in our module so various monkeypatches can access it later!
|
31
32
|
PGCrypto[table_name][encrypted_column_name] = options.symbolize_keys!
|
32
33
|
|
@@ -35,7 +36,7 @@ module PGCrypto
|
|
35
36
|
def #{column_name}
|
36
37
|
@attributes["#{column_name}"]
|
37
38
|
end
|
38
|
-
|
39
|
+
|
39
40
|
# We write the attribute twice - once as the alias so the accessor keeps working, and once
|
40
41
|
# so the actual attribute value is dirty and will be queued up for assignment
|
41
42
|
def #{column_name}=(value)
|
@@ -50,7 +50,7 @@ ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.class_eval do
|
|
50
50
|
if !PGCrypto[projection.relation.name].empty?
|
51
51
|
# Okay, so first, check if it's a broad select
|
52
52
|
if projection.name == '*'
|
53
|
-
# In this case, we want to just
|
53
|
+
# In this case, we want to just grab all the keys from columns in this table
|
54
54
|
# and select them fancy-like
|
55
55
|
PGCrypto[projection.relation.name].each do |column, options|
|
56
56
|
new_projections.push(pgcrypto_tweak_select_column(column, options, joins))
|
@@ -61,7 +61,7 @@ ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.class_eval do
|
|
61
61
|
end
|
62
62
|
end
|
63
63
|
end
|
64
|
-
core.projections.push(*new_projections)
|
64
|
+
core.projections.push(*new_projections.compact)
|
65
65
|
|
66
66
|
# Dios mio! What an operation! Now we'll do something similar for the WHERE statements
|
67
67
|
core.wheres.each do |where|
|
data/pgcrypto.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "pgcrypto"
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Flip Sasser"]
|
12
|
-
s.date = "2012-02-
|
12
|
+
s.date = "2012-02-28"
|
13
13
|
s.description = "\n PGCrypto is an ActiveRecord::Base extension that allows you to asymmetrically\n encrypt PostgreSQL columns with as little trouble as possible. It's totally\n freaking rad.\n "
|
14
14
|
s.email = "flip@x451.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -27,7 +27,8 @@ Gem::Specification.new do |s|
|
|
27
27
|
"lib/pgcrypto/active_record.rb",
|
28
28
|
"lib/pgcrypto/arel.rb",
|
29
29
|
"lib/pgcrypto/key.rb",
|
30
|
-
"lib/pgcrypto/table_manager.rb"
|
30
|
+
"lib/pgcrypto/table_manager.rb",
|
31
|
+
"pgcrypto.gemspec"
|
31
32
|
]
|
32
33
|
s.homepage = "http://github.com/Plinq/pgcrypto"
|
33
34
|
s.require_paths = ["lib"]
|