magiclabs-userstamp 2.0.2 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +7 -10
- data/Rakefile +0 -16
- data/Readme.rdoc +11 -12
- data/VERSION +1 -1
- data/lib/stampable.rb +0 -2
- data/magiclabs-userstamp.gemspec +8 -11
- metadata +30 -36
- data/Gemfile.lock +0 -55
- data/init.rb +0 -1
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b4e70b4e78435726a3a05fd24a9d8a6da615be83
|
4
|
+
data.tar.gz: 7d3dea09ccaef21dafaa8c47dbd15ae0fbba5c3c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 26a9b90934a0d9c5c4ddb5834860cb7a88bbeb41923e5740133f74bded277a813945b7e40f41dd7e24fc74ec3f0187985bf6c9afa615c8be0bb13275171ba871
|
7
|
+
data.tar.gz: bd0ca48484ddc04b7cafa0b48e6f2b41ef1f5c8bd96a1319e44ff5cde52a454b8b83d98b962bc5cbca33ca604bd5a36e334c9c0b01aedd76c050f28da71d176b
|
data/Gemfile
CHANGED
@@ -1,11 +1,8 @@
|
|
1
|
-
source
|
1
|
+
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
gem 'actionpack', :require => 'action_pack'
|
10
|
-
gem 'sqlite3-ruby', :require => 'sqlite3'
|
11
|
-
end
|
3
|
+
gem 'rake'
|
4
|
+
gem 'redgreen'
|
5
|
+
gem 'activerecord', :require => 'active_record'
|
6
|
+
gem 'activesupport', :require => 'active_support'
|
7
|
+
gem 'actionpack', :require => 'action_pack'
|
8
|
+
gem 'sqlite3-ruby', :require => 'sqlite3'
|
data/Rakefile
CHANGED
@@ -20,19 +20,3 @@ Rake::RDocTask.new(:rdoc) do |rdoc|
|
|
20
20
|
rdoc.rdoc_files.include('Readme.rdoc', 'CHANGELOG', 'LICENSE')
|
21
21
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
22
22
|
end
|
23
|
-
|
24
|
-
begin
|
25
|
-
require 'jeweler'
|
26
|
-
project_name = 'magiclabs-userstamp'
|
27
|
-
Jeweler::Tasks.new do |gem|
|
28
|
-
gem.name = project_name
|
29
|
-
gem.summary = "This Rails plugin extends ActiveRecord::Base to add automatic updating of created_by and updated_by attributes of your models in much the same way that the ActiveRecord::Timestamp module updates created_(at/on) and updated_(at/on) attributes."
|
30
|
-
gem.email = "delynn@gmail.com"
|
31
|
-
gem.homepage = "https://github.com/magiclabs/userstamp"
|
32
|
-
gem.authors = ["DeLynn Berry"]
|
33
|
-
end
|
34
|
-
|
35
|
-
Jeweler::GemcutterTasks.new
|
36
|
-
rescue LoadError
|
37
|
-
puts "Jeweler, or one of its dependencies, is not available. Install it with: gem install jeweler"
|
38
|
-
end
|
data/Readme.rdoc
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
== Fork Details
|
5
5
|
|
6
|
-
This is a fork of the grosser fork [https://github.com/grosser/userstamp] of the original userstamp plugin created by delynn [https://github.com/delynn/userstamp].
|
6
|
+
This is a fork of the grosser fork [https://github.com/grosser/userstamp] of the original userstamp plugin created by delynn [https://github.com/delynn/userstamp].
|
7
7
|
|
8
8
|
This fork has been created to combine the grosser changes that enable use of the plugin within applications that perform soft deletes but are not using the acts_as_paranoid plugin/gem (for example this fork can now be used in conjunction with the rails3_acts_as_paranoid plugin/gem [https://github.com/goncalossilva/rails3_acts_as_paranoid]).
|
9
9
|
|
@@ -11,14 +11,14 @@ This fork also includes changes to perform the model stamping before validation
|
|
11
11
|
|
12
12
|
validates :created_by, :presence => true
|
13
13
|
validates :updated_by, :presence => true
|
14
|
-
|
15
|
-
|
14
|
+
|
15
|
+
|
16
16
|
== Using the Fork
|
17
17
|
|
18
18
|
To use this fork add the following to your application gemfile:
|
19
19
|
|
20
20
|
gem 'userstamp', :git => "git://github.com/insphire/userstamp.git"
|
21
|
-
|
21
|
+
|
22
22
|
|
23
23
|
== Overview
|
24
24
|
|
@@ -80,16 +80,15 @@ Assume a weblog application has User and Post objects.
|
|
80
80
|
include Userstamp
|
81
81
|
end
|
82
82
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
comes in. So in our example we'll want to use this method in both our User and Post classes:
|
83
|
+
More than likely you want all your associations setup on your stamped objects,
|
84
|
+
and that's where the <tt>stampable</tt> class method comes in.
|
85
|
+
So in our example we'll want to use this method in both our User and Post classes:
|
87
86
|
|
88
87
|
class User < ActiveRecord::Base
|
89
88
|
model_stamper
|
90
89
|
stampable
|
91
90
|
end
|
92
|
-
|
91
|
+
|
93
92
|
class Post < ActiveRecord::Base
|
94
93
|
stampable
|
95
94
|
end
|
@@ -103,7 +102,7 @@ User class. They are #stamper= and #stamper and look like this:
|
|
103
102
|
else
|
104
103
|
object
|
105
104
|
end
|
106
|
-
|
105
|
+
|
107
106
|
Thread.current["#{self.to_s.downcase}_#{self.object_id}_stamper"] = object_stamper
|
108
107
|
end
|
109
108
|
|
@@ -143,7 +142,7 @@ completely customized. Here's an quick example:
|
|
143
142
|
== Upgrade from 1.x
|
144
143
|
# config/environment.rb
|
145
144
|
Ddb::Userstamp.compatibility_mode = true
|
146
|
-
|
145
|
+
|
147
146
|
{Example userstamp application}[http://github.com/delynn/userstamp_sample]
|
148
147
|
|
149
148
|
== Running Unit Tests
|
@@ -160,4 +159,4 @@ The original idea for this plugin came from the Rails Wiki article entitled
|
|
160
159
|
== Contributors / maintenance / enhancement
|
161
160
|
- {Michael Grosser}[http://pragmatig.com]
|
162
161
|
- {John Dell}[http://blog.spovich.com/]
|
163
|
-
- Chris Hilton
|
162
|
+
- Chris Hilton
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0
|
1
|
+
2.1.0
|
data/lib/stampable.rb
CHANGED
data/magiclabs-userstamp.gemspec
CHANGED
@@ -1,28 +1,27 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
1
|
# -*- encoding: utf-8 -*-
|
5
2
|
|
6
3
|
Gem::Specification.new do |s|
|
7
4
|
s.name = "magiclabs-userstamp"
|
8
|
-
s.version =
|
5
|
+
s.version = File.read(File.join(File.dirname(__FILE__), 'VERSION')).strip
|
9
6
|
|
7
|
+
s.authors = ["DeLynn Berry", "Thomas von Deyen"]
|
8
|
+
s.homepage = "https://github.com/magiclabs/userstamp"
|
9
|
+
s.email = ["tvd@magiclabs.de"]
|
10
|
+
s.summary = "Adds magic creator and updater attributes to your ActiveRecord models."
|
11
|
+
s.description = "This gem extends ActiveRecord::Base to add automatic updating of created_by and updated_by attributes of your models in much the same way that the ActiveRecord::Timestamp module updates created_(at/on) and updated_(at/on) attributes."
|
12
|
+
s.licenses = ["MIT"]
|
10
13
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
|
12
|
-
s.date = "2011-11-07"
|
13
|
-
s.email = "delynn@gmail.com"
|
14
|
+
|
14
15
|
s.extra_rdoc_files = [
|
15
16
|
"LICENSE"
|
16
17
|
]
|
17
18
|
s.files = [
|
18
19
|
"CHANGELOG",
|
19
20
|
"Gemfile",
|
20
|
-
"Gemfile.lock",
|
21
21
|
"LICENSE",
|
22
22
|
"Rakefile",
|
23
23
|
"Readme.rdoc",
|
24
24
|
"VERSION",
|
25
|
-
"init.rb",
|
26
25
|
"lib/migration_helper.rb",
|
27
26
|
"lib/stampable.rb",
|
28
27
|
"lib/stamper.rb",
|
@@ -68,10 +67,8 @@ Gem::Specification.new do |s|
|
|
68
67
|
"test/userstamp_controller_test.rb",
|
69
68
|
"test/userstamp_test.rb"
|
70
69
|
]
|
71
|
-
s.homepage = "https://github.com/magiclabs/userstamp"
|
72
70
|
s.require_paths = ["lib"]
|
73
71
|
s.rubygems_version = "1.8.11"
|
74
|
-
s.summary = "This Rails plugin extends ActiveRecord::Base to add automatic updating of created_by and updated_by attributes of your models in much the same way that the ActiveRecord::Timestamp module updates created_(at/on) and updated_(at/on) attributes."
|
75
72
|
|
76
73
|
if s.respond_to? :specification_version then
|
77
74
|
s.specification_version = 3
|
metadata
CHANGED
@@ -1,35 +1,32 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: magiclabs-userstamp
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
version: 2.0.2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.1.0
|
6
5
|
platform: ruby
|
7
|
-
authors:
|
6
|
+
authors:
|
8
7
|
- DeLynn Berry
|
8
|
+
- Thomas von Deyen
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
date: 2011-11-07 00:00:00 Z
|
12
|
+
date: 2014-03-27 00:00:00.000000000 Z
|
14
13
|
dependencies: []
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
description: This gem extends ActiveRecord::Base to add automatic updating of created_by
|
15
|
+
and updated_by attributes of your models in much the same way that the ActiveRecord::Timestamp
|
16
|
+
module updates created_(at/on) and updated_(at/on) attributes.
|
17
|
+
email:
|
18
|
+
- tvd@magiclabs.de
|
18
19
|
executables: []
|
19
|
-
|
20
20
|
extensions: []
|
21
|
-
|
22
|
-
extra_rdoc_files:
|
21
|
+
extra_rdoc_files:
|
23
22
|
- LICENSE
|
24
|
-
files:
|
23
|
+
files:
|
25
24
|
- CHANGELOG
|
26
25
|
- Gemfile
|
27
|
-
- Gemfile.lock
|
28
26
|
- LICENSE
|
29
27
|
- Rakefile
|
30
28
|
- Readme.rdoc
|
31
29
|
- VERSION
|
32
|
-
- init.rb
|
33
30
|
- lib/migration_helper.rb
|
34
31
|
- lib/stampable.rb
|
35
32
|
- lib/stamper.rb
|
@@ -75,31 +72,28 @@ files:
|
|
75
72
|
- test/userstamp_controller_test.rb
|
76
73
|
- test/userstamp_test.rb
|
77
74
|
homepage: https://github.com/magiclabs/userstamp
|
78
|
-
licenses:
|
79
|
-
|
75
|
+
licenses:
|
76
|
+
- MIT
|
77
|
+
metadata: {}
|
80
78
|
post_install_message:
|
81
79
|
rdoc_options: []
|
82
|
-
|
83
|
-
require_paths:
|
80
|
+
require_paths:
|
84
81
|
- lib
|
85
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: "0"
|
82
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
83
|
+
requirements:
|
84
|
+
- - '>='
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '0'
|
87
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - '>='
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '0'
|
97
92
|
requirements: []
|
98
|
-
|
99
93
|
rubyforge_project:
|
100
|
-
rubygems_version: 1.
|
94
|
+
rubygems_version: 2.1.11
|
101
95
|
signing_key:
|
102
96
|
specification_version: 3
|
103
|
-
summary:
|
97
|
+
summary: Adds magic creator and updater attributes to your ActiveRecord models.
|
104
98
|
test_files: []
|
105
|
-
|
99
|
+
has_rdoc:
|
data/Gemfile.lock
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: http://rubygems.org/
|
3
|
-
specs:
|
4
|
-
abstract (1.0.0)
|
5
|
-
actionpack (3.0.3)
|
6
|
-
activemodel (= 3.0.3)
|
7
|
-
activesupport (= 3.0.3)
|
8
|
-
builder (~> 2.1.2)
|
9
|
-
erubis (~> 2.6.6)
|
10
|
-
i18n (~> 0.4)
|
11
|
-
rack (~> 1.2.1)
|
12
|
-
rack-mount (~> 0.6.13)
|
13
|
-
rack-test (~> 0.5.6)
|
14
|
-
tzinfo (~> 0.3.23)
|
15
|
-
activemodel (3.0.3)
|
16
|
-
activesupport (= 3.0.3)
|
17
|
-
builder (~> 2.1.2)
|
18
|
-
i18n (~> 0.4)
|
19
|
-
activerecord (3.0.3)
|
20
|
-
activemodel (= 3.0.3)
|
21
|
-
activesupport (= 3.0.3)
|
22
|
-
arel (~> 2.0.2)
|
23
|
-
tzinfo (~> 0.3.23)
|
24
|
-
activesupport (3.0.3)
|
25
|
-
arel (2.0.6)
|
26
|
-
builder (2.1.2)
|
27
|
-
erubis (2.6.6)
|
28
|
-
abstract (>= 1.0.0)
|
29
|
-
git (1.2.5)
|
30
|
-
i18n (0.5.0)
|
31
|
-
jeweler (1.5.2)
|
32
|
-
bundler (~> 1.0.0)
|
33
|
-
git (>= 1.2.5)
|
34
|
-
rake
|
35
|
-
rack (1.2.1)
|
36
|
-
rack-mount (0.6.13)
|
37
|
-
rack (>= 1.0.0)
|
38
|
-
rack-test (0.5.7)
|
39
|
-
rack (>= 1.0)
|
40
|
-
rake (0.8.7)
|
41
|
-
redgreen (1.2.2)
|
42
|
-
sqlite3-ruby (1.3.2)
|
43
|
-
tzinfo (0.3.23)
|
44
|
-
|
45
|
-
PLATFORMS
|
46
|
-
ruby
|
47
|
-
|
48
|
-
DEPENDENCIES
|
49
|
-
actionpack
|
50
|
-
activerecord
|
51
|
-
activesupport
|
52
|
-
jeweler
|
53
|
-
rake
|
54
|
-
redgreen
|
55
|
-
sqlite3-ruby
|
data/init.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require 'userstamp'
|