activerecord-custom_timestamps 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
data/README.md
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
Custom Timestamps for ActiveRecord 3.x/4.x and Rails 3.x/4.x
|
2
2
|
=====
|
3
3
|
|
4
|
-
|
4
|
+
Sometimes you may need to use timestamp columns other than created_at/created_on and updated_at/updated_on, e.g. when you are using a legacy database. Custom Timestamps lets you define one or more additional columns to update just like Rails updates created_at/created_on and/or updated_at/updated_on.
|
5
5
|
|
6
|
-
|
6
|
+
This does not change "timestamps" behavior in migrations. New models will continue to get updated_at/created_at or whatever you have designated, nor should it affect existing behavior in Rails (ActiveRecord::Timestamp) that looks for created_at/created_on and updated_at/updated_on and updates those on create/update.
|
7
7
|
|
8
|
-
It uses the Rails 3.
|
8
|
+
It uses the Rails/ActiveRecord 3.x-4.x self.record_timestamps to determine if it should update the date of the created_timestamp column(s) and should_record_timestamps? to determine if it should update the date of the updated_timestamp column(s) and it does these in the private create and update methods that then call super to execute the default ActiveRecord::Timestamp defined create and update methods.
|
9
9
|
|
10
10
|
### Setup
|
11
11
|
|
metadata
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
name: activerecord-custom_timestamps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Gary S. Weaver
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-08-
|
12
|
+
date: 2012-08-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|