truthy_date 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/truthy_date.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 740737d9fe2e84ce680e5bca951f75370d4bd1f8
|
4
|
+
data.tar.gz: 1de9754ce3e7cd5b48f7233ab2924968364e89dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 805b8c71457ebeba9201143439e2c2e8c5abf3ff5082eab18fae1359b8a54b74c7587f2487b57c493e4f645b114133c2e10c86fd4705ac428e5531d4c2a9a065
|
7
|
+
data.tar.gz: 39644f2fd920ada6941ae3e7c14fd59d3c61394a0748f8b6c45170ad662ee9dd1a4c38d5e3c51f72bed83534457881786b855a85bf5ac9e03dcef22bb1f42c12
|
data/lib/truthy_date.rb
CHANGED
@@ -3,11 +3,11 @@ module TruthyDate
|
|
3
3
|
raise ArgumentError, "missing :as for truthy_date" unless options[:as]
|
4
4
|
|
5
5
|
define_method("#{options[:as]}=") do |value|
|
6
|
-
self.send("#{attribute}=",
|
6
|
+
self.send("#{attribute}=", ActiveRecord::Type::Boolean.new.type_cast_from_database(value) ? Time.now : nil)
|
7
7
|
end
|
8
8
|
|
9
9
|
define_method("#{options[:as]}?") do
|
10
|
-
self.send(attribute)
|
10
|
+
!!self.send(attribute)
|
11
11
|
end
|
12
12
|
|
13
13
|
define_method("#{options[:as]}") do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: truthy_date
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Connor
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -51,7 +51,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
51
51
|
version: '0'
|
52
52
|
requirements: []
|
53
53
|
rubyforge_project:
|
54
|
-
rubygems_version: 2.
|
54
|
+
rubygems_version: 2.4.5
|
55
55
|
signing_key:
|
56
56
|
specification_version: 4
|
57
57
|
summary: Provides getters/setters for when datetimes should also act like booleans
|