masked-identifier 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/masked-identifier.rb +2 -1
- data/test/dummy/log/development.log +10 -0
- data/test/dummy/log/test.log +44 -0
- metadata +23 -29
data/lib/masked-identifier.rb
CHANGED
@@ -35,7 +35,8 @@ module MaskedIdentifier
|
|
35
35
|
def has_masked_identifier(options = {})
|
36
36
|
options[:property] ||= 'masked_identifier'
|
37
37
|
self._masked_identifier_options = options
|
38
|
-
|
38
|
+
before_create :add_masked_identifier
|
39
|
+
# before_save :add_masked_identifier, on: :create
|
39
40
|
send :include, InstanceMethods
|
40
41
|
end
|
41
42
|
end
|
@@ -141,3 +141,13 @@ Migrating to CreateUsers (20110731204706)
|
|
141
141
|
[1m[35m (3.2ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
142
142
|
[1m[36m (0.1ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
143
143
|
[1m[35m (3.0ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20110731204706')
|
144
|
+
[1m[36m (0.5ms)[0m [1mSELECT "schema_migrations"."version" FROM "schema_migrations" [0m
|
145
|
+
[1m[35m (0.2ms)[0m select sqlite_version(*)
|
146
|
+
[1m[36m (2.8ms)[0m [1mCREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "masked_identifier" varchar(255), "mid" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
147
|
+
[1m[35m (0.2ms)[0m PRAGMA index_list("users")
|
148
|
+
[1m[36m (2.4ms)[0m [1mCREATE INDEX "index_users_on_masked_identifier" ON "users" ("masked_identifier")[0m
|
149
|
+
[1m[35m (2.7ms)[0m CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
|
150
|
+
[1m[36m (0.1ms)[0m [1mPRAGMA index_list("schema_migrations")[0m
|
151
|
+
[1m[35m (3.3ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
152
|
+
[1m[36m (0.1ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
153
|
+
[1m[35m (2.8ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20110731204706')
|
data/test/dummy/log/test.log
CHANGED
@@ -403,3 +403,47 @@
|
|
403
403
|
[1m[35m (0.1ms)[0m SELECT 1 FROM "users" WHERE "users"."masked_identifier" = 'aacdaadacb' LIMIT 1
|
404
404
|
[1m[36mSQL (0.6ms)[0m [1mINSERT INTO "users" ("created_at", "masked_identifier", "mid", "updated_at") VALUES (?, ?, ?, ?)[0m [["created_at", Mon, 01 Aug 2011 07:11:12 UTC +00:00], ["masked_identifier", "aacdaadacb"], ["mid", nil], ["updated_at", Mon, 01 Aug 2011 07:11:12 UTC +00:00]]
|
405
405
|
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
406
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
407
|
+
[1m[35m (0.2ms)[0m SELECT 1 FROM "users" WHERE "users"."masked_identifier" = 'AdwfxcimRN' LIMIT 1
|
408
|
+
[1m[36mSQL (38.3ms)[0m [1mINSERT INTO "users" ("created_at", "masked_identifier", "mid", "updated_at") VALUES (?, ?, ?, ?)[0m [["created_at", Thu, 25 Aug 2011 03:03:42 UTC +00:00], ["masked_identifier", "AdwfxcimRN"], ["mid", nil], ["updated_at", Thu, 25 Aug 2011 03:03:42 UTC +00:00]]
|
409
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
410
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
411
|
+
[1m[35m (0.1ms)[0m SELECT 1 FROM "users" WHERE "users"."masked_identifier" = 'dcdKdG' LIMIT 1
|
412
|
+
[1m[36mSQL (0.6ms)[0m [1mINSERT INTO "users" ("created_at", "masked_identifier", "mid", "updated_at") VALUES (?, ?, ?, ?)[0m [["created_at", Thu, 25 Aug 2011 03:03:42 UTC +00:00], ["masked_identifier", "dcdKdG"], ["mid", nil], ["updated_at", Thu, 25 Aug 2011 03:03:42 UTC +00:00]]
|
413
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
414
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
415
|
+
[1m[35m (0.0ms)[0m ROLLBACK TO SAVEPOINT active_record_1
|
416
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
417
|
+
[1m[35m (0.2ms)[0m SELECT 1 FROM "users" WHERE "users"."masked_identifier" = 'a' LIMIT 1
|
418
|
+
[1m[36mSQL (0.7ms)[0m [1mINSERT INTO "users" ("created_at", "masked_identifier", "mid", "updated_at") VALUES (?, ?, ?, ?)[0m [["created_at", Thu, 25 Aug 2011 03:03:42 UTC +00:00], ["masked_identifier", "a"], ["mid", nil], ["updated_at", Thu, 25 Aug 2011 03:03:42 UTC +00:00]]
|
419
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
420
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
421
|
+
[1m[35m (0.1ms)[0m SELECT 1 FROM "users" WHERE "users"."masked_identifier" = 'a' LIMIT 1
|
422
|
+
[1m[36m (0.1ms)[0m [1mSELECT 1 FROM "users" WHERE "users"."masked_identifier" = 'a' LIMIT 1[0m
|
423
|
+
[1m[35m (0.0ms)[0m SELECT 1 FROM "users" WHERE "users"."masked_identifier" = 'a' LIMIT 1
|
424
|
+
[1m[36m (0.0ms)[0m [1mSELECT 1 FROM "users" WHERE "users"."masked_identifier" = 'a' LIMIT 1[0m
|
425
|
+
[1m[35m (0.0ms)[0m SELECT 1 FROM "users" WHERE "users"."masked_identifier" = 'a' LIMIT 1
|
426
|
+
[1m[36m (0.0ms)[0m [1mSELECT 1 FROM "users" WHERE "users"."masked_identifier" = 'a' LIMIT 1[0m
|
427
|
+
[1m[35m (0.0ms)[0m SELECT 1 FROM "users" WHERE "users"."masked_identifier" = 'a' LIMIT 1
|
428
|
+
[1m[36m (0.0ms)[0m [1mSELECT 1 FROM "users" WHERE "users"."masked_identifier" = 'a' LIMIT 1[0m
|
429
|
+
[1m[35m (0.0ms)[0m SELECT 1 FROM "users" WHERE "users"."masked_identifier" = 'a' LIMIT 1
|
430
|
+
[1m[36m (0.1ms)[0m [1mSELECT 1 FROM "users" WHERE "users"."masked_identifier" = 'a' LIMIT 1[0m
|
431
|
+
[1m[35m (0.1ms)[0m SELECT 1 FROM "users" WHERE "users"."masked_identifier" = 'a' LIMIT 1
|
432
|
+
[1m[36m (0.0ms)[0m [1mSELECT 1 FROM "users" WHERE "users"."masked_identifier" = 'a' LIMIT 1[0m
|
433
|
+
[1m[35m (0.0ms)[0m SELECT 1 FROM "users" WHERE "users"."masked_identifier" = 'a' LIMIT 1
|
434
|
+
[1m[36m (0.1ms)[0m [1mSELECT 1 FROM "users" WHERE "users"."masked_identifier" = 'a' LIMIT 1[0m
|
435
|
+
[1m[35m (0.0ms)[0m SELECT 1 FROM "users" WHERE "users"."masked_identifier" = 'a' LIMIT 1
|
436
|
+
[1m[36m (0.1ms)[0m [1mSELECT 1 FROM "users" WHERE "users"."masked_identifier" = 'a' LIMIT 1[0m
|
437
|
+
[1m[35m (0.1ms)[0m SELECT 1 FROM "users" WHERE "users"."masked_identifier" = 'a' LIMIT 1
|
438
|
+
[1m[36m (0.0ms)[0m [1mSELECT 1 FROM "users" WHERE "users"."masked_identifier" = 'a' LIMIT 1[0m
|
439
|
+
[1m[35m (0.1ms)[0m SELECT 1 FROM "users" WHERE "users"."masked_identifier" = 'a' LIMIT 1
|
440
|
+
[1m[36m (0.1ms)[0m [1mSELECT 1 FROM "users" WHERE "users"."masked_identifier" = 'a' LIMIT 1[0m
|
441
|
+
[1m[35m (0.0ms)[0m ROLLBACK TO SAVEPOINT active_record_1
|
442
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
443
|
+
[1m[35m (0.1ms)[0m SELECT 1 FROM "users" WHERE "users"."mid" = 'YO1zOG7QZw' LIMIT 1
|
444
|
+
[1m[36mSQL (0.7ms)[0m [1mINSERT INTO "users" ("created_at", "masked_identifier", "mid", "updated_at") VALUES (?, ?, ?, ?)[0m [["created_at", Thu, 25 Aug 2011 03:03:42 UTC +00:00], ["masked_identifier", nil], ["mid", "YO1zOG7QZw"], ["updated_at", Thu, 25 Aug 2011 03:03:42 UTC +00:00]]
|
445
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
446
|
+
[1m[36m (0.0ms)[0m [1mSAVEPOINT active_record_1[0m
|
447
|
+
[1m[35m (0.1ms)[0m SELECT 1 FROM "users" WHERE "users"."masked_identifier" = 'adcbbcaada' LIMIT 1
|
448
|
+
[1m[36mSQL (0.6ms)[0m [1mINSERT INTO "users" ("created_at", "masked_identifier", "mid", "updated_at") VALUES (?, ?, ?, ?)[0m [["created_at", Thu, 25 Aug 2011 03:03:42 UTC +00:00], ["masked_identifier", "adcbbcaada"], ["mid", nil], ["updated_at", Thu, 25 Aug 2011 03:03:42 UTC +00:00]]
|
449
|
+
[1m[35m (0.1ms)[0m RELEASE SAVEPOINT active_record_1
|
metadata
CHANGED
@@ -1,28 +1,24 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: masked-identifier
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.5
|
4
5
|
prerelease:
|
5
|
-
version: 0.0.4
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Matt Hodan
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
date: 2011-08-01 00:00:00 Z
|
12
|
+
date: 2011-08-25 00:00:00.000000000Z
|
14
13
|
dependencies: []
|
15
|
-
|
16
|
-
|
17
|
-
email:
|
14
|
+
description: Automatically adds a masked identifier to an ActiveRecord object on create. View
|
15
|
+
the project GitHub page for more info.
|
16
|
+
email:
|
18
17
|
- matthew.c.hodan@gmail.com
|
19
18
|
executables: []
|
20
|
-
|
21
19
|
extensions: []
|
22
|
-
|
23
20
|
extra_rdoc_files: []
|
24
|
-
|
25
|
-
files:
|
21
|
+
files:
|
26
22
|
- lib/code-generator.rb
|
27
23
|
- lib/masked-identifier.rb
|
28
24
|
- lib/tasks/masked-identifier_tasks.rake
|
@@ -70,32 +66,30 @@ files:
|
|
70
66
|
- test/test_helper.rb
|
71
67
|
homepage: http://github.com/matthodan/masked-identifier
|
72
68
|
licenses: []
|
73
|
-
|
74
69
|
post_install_message:
|
75
70
|
rdoc_options: []
|
76
|
-
|
77
|
-
require_paths:
|
71
|
+
require_paths:
|
78
72
|
- lib
|
79
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
73
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
80
74
|
none: false
|
81
|
-
requirements:
|
82
|
-
- -
|
83
|
-
- !ruby/object:Gem::Version
|
84
|
-
version:
|
85
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
|
+
- - ! '>='
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
79
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
86
80
|
none: false
|
87
|
-
requirements:
|
88
|
-
- -
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
version:
|
81
|
+
requirements:
|
82
|
+
- - ! '>='
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '0'
|
91
85
|
requirements: []
|
92
|
-
|
93
86
|
rubyforge_project:
|
94
87
|
rubygems_version: 1.8.6
|
95
88
|
signing_key:
|
96
89
|
specification_version: 3
|
97
|
-
summary: Use a masked identifier as a non-incrementing reference to an ActiveRecord
|
98
|
-
|
90
|
+
summary: Use a masked identifier as a non-incrementing reference to an ActiveRecord
|
91
|
+
object
|
92
|
+
test_files:
|
99
93
|
- test/dummy/app/assets/javascripts/application.js
|
100
94
|
- test/dummy/app/assets/stylesheets/application.css
|
101
95
|
- test/dummy/app/controllers/application_controller.rb
|