bool_at 0.2.1 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +32 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +22 -22
- data/README.md +3 -4
- data/lib/bool_at/macro.rb +1 -1
- data/lib/bool_at/version.rb +1 -1
- data/lib/bool_at.rb +1 -1
- data/spec/bool_at/macro_spec.rb +8 -0
- metadata +5 -4
- data/.travis.yml +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 378cc41fd1448afcf1b47d09fd5d96aee6e414adf057b218da434e7e3cee4d4a
|
4
|
+
data.tar.gz: bb31cdbc37748166d2c0b8a57e7b09bbcecc21b195542e1952ba7112ae829c06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18b300a0d8970502875b9029c0b3770f3e429ce05bef914368b0c4a43f4ffc50ac4396fbb1704bbcdeabbad04d50f56dc93f31878226e1108e1909eade7f6a8b
|
7
|
+
data.tar.gz: 05ee52f2371b040b63697bd4e78dcf80477541d506e06c4463d4501e2196ec901dbe1b2820cb1d6019df17aa3ac6e3d26f5dcbe88409985fef8b15faeaf7fcf3
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# Use the latest 2.1 version of CircleCI pipeline process engine.
|
2
|
+
# See: https://circleci.com/docs/2.0/configuration-reference
|
3
|
+
version: 2.1
|
4
|
+
|
5
|
+
# Orbs are reusable packages of CircleCI configuration that you may share across projects, enabling you to create encapsulated, parameterized commands, jobs, and executors that can be used across multiple projects.
|
6
|
+
# See: https://circleci.com/docs/2.0/orb-intro/
|
7
|
+
orbs:
|
8
|
+
ruby: circleci/ruby@1.4.0
|
9
|
+
|
10
|
+
# Define a job to be invoked later in a workflow.
|
11
|
+
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
|
12
|
+
jobs:
|
13
|
+
build-test:
|
14
|
+
docker:
|
15
|
+
- image: cimg/ruby:3.1.0
|
16
|
+
executor: ruby/default
|
17
|
+
steps:
|
18
|
+
- checkout
|
19
|
+
- run:
|
20
|
+
name: Which bundler?
|
21
|
+
command: bundle -v
|
22
|
+
- run: bundle install
|
23
|
+
- run: bundle exec rspec
|
24
|
+
|
25
|
+
# Invoke jobs via workflows
|
26
|
+
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
|
27
|
+
workflows:
|
28
|
+
test: # This is the name of the workflow, feel free to change it to better match your workflow.
|
29
|
+
# Inside the workflow, you define the jobs you want to run.
|
30
|
+
jobs:
|
31
|
+
- build-test
|
32
|
+
|
data/CHANGELOG.md
ADDED
data/Gemfile.lock
CHANGED
@@ -1,31 +1,31 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
bool_at (0.2.
|
4
|
+
bool_at (0.2.1)
|
5
5
|
activerecord (>= 6)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
actionpack (6.1.
|
11
|
-
actionview (= 6.1.
|
12
|
-
activesupport (= 6.1.
|
10
|
+
actionpack (6.1.5)
|
11
|
+
actionview (= 6.1.5)
|
12
|
+
activesupport (= 6.1.5)
|
13
13
|
rack (~> 2.0, >= 2.0.9)
|
14
14
|
rack-test (>= 0.6.3)
|
15
15
|
rails-dom-testing (~> 2.0)
|
16
16
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
17
|
-
actionview (6.1.
|
18
|
-
activesupport (= 6.1.
|
17
|
+
actionview (6.1.5)
|
18
|
+
activesupport (= 6.1.5)
|
19
19
|
builder (~> 3.1)
|
20
20
|
erubi (~> 1.4)
|
21
21
|
rails-dom-testing (~> 2.0)
|
22
22
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
23
|
-
activemodel (6.1.
|
24
|
-
activesupport (= 6.1.
|
25
|
-
activerecord (6.1.
|
26
|
-
activemodel (= 6.1.
|
27
|
-
activesupport (= 6.1.
|
28
|
-
activesupport (6.1.
|
23
|
+
activemodel (6.1.5)
|
24
|
+
activesupport (= 6.1.5)
|
25
|
+
activerecord (6.1.5)
|
26
|
+
activemodel (= 6.1.5)
|
27
|
+
activesupport (= 6.1.5)
|
28
|
+
activesupport (6.1.5)
|
29
29
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
30
30
|
i18n (>= 1.6, < 2)
|
31
31
|
minitest (>= 5.1)
|
@@ -38,16 +38,16 @@ GEM
|
|
38
38
|
crass (1.0.6)
|
39
39
|
diff-lcs (1.5.0)
|
40
40
|
erubi (1.10.0)
|
41
|
-
i18n (1.
|
41
|
+
i18n (1.10.0)
|
42
42
|
concurrent-ruby (~> 1.0)
|
43
|
-
loofah (2.
|
43
|
+
loofah (2.15.0)
|
44
44
|
crass (~> 1.0.2)
|
45
45
|
nokogiri (>= 1.5.9)
|
46
46
|
method_source (0.9.2)
|
47
|
-
mini_portile2 (2.
|
47
|
+
mini_portile2 (2.8.0)
|
48
48
|
minitest (5.15.0)
|
49
|
-
nokogiri (1.13.
|
50
|
-
mini_portile2 (~> 2.
|
49
|
+
nokogiri (1.13.4)
|
50
|
+
mini_portile2 (~> 2.8.0)
|
51
51
|
racc (~> 1.4)
|
52
52
|
parallel (1.21.0)
|
53
53
|
parser (3.1.0.0)
|
@@ -64,11 +64,11 @@ GEM
|
|
64
64
|
nokogiri (>= 1.6)
|
65
65
|
rails-html-sanitizer (1.4.2)
|
66
66
|
loofah (~> 2.3)
|
67
|
-
railties (6.1.
|
68
|
-
actionpack (= 6.1.
|
69
|
-
activesupport (= 6.1.
|
67
|
+
railties (6.1.5)
|
68
|
+
actionpack (= 6.1.5)
|
69
|
+
activesupport (= 6.1.5)
|
70
70
|
method_source
|
71
|
-
rake (>=
|
71
|
+
rake (>= 12.2)
|
72
72
|
thor (~> 1.0)
|
73
73
|
rainbow (3.1.1)
|
74
74
|
rake (13.0.6)
|
@@ -123,4 +123,4 @@ DEPENDENCIES
|
|
123
123
|
standalone_migrations (>= 6)
|
124
124
|
|
125
125
|
BUNDLED WITH
|
126
|
-
2.3.
|
126
|
+
2.3.9
|
data/README.md
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
[![
|
2
|
-
|
1
|
+
[![CircleCI](https://circleci.com/gh/elithecho/bool_at/tree/master.svg?style=svg)](https://circleci.com/gh/elithecho/bool_at/tree/master)
|
3
2
|
|
4
3
|
## Installation
|
5
4
|
|
@@ -61,7 +60,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
61
60
|
|
62
61
|
## Contributing
|
63
62
|
|
64
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
63
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/elithecho/bool_at. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
65
64
|
|
66
65
|
## License
|
67
66
|
|
@@ -69,4 +68,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
69
68
|
|
70
69
|
## Code of Conduct
|
71
70
|
|
72
|
-
Everyone interacting in the BoolAt project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
71
|
+
Everyone interacting in the BoolAt project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/elithecho/bool_at/blob/master/CODE_OF_CONDUCT.md).
|
data/lib/bool_at/macro.rb
CHANGED
@@ -19,7 +19,7 @@ module BoolAt
|
|
19
19
|
# Changes dirty state in virtual attribute
|
20
20
|
define_method setter do |value|
|
21
21
|
super(value)
|
22
|
-
send(at_setter, self[attr] ? Time.now : nil)
|
22
|
+
send(at_setter, self[attr] ? self[at_attribute] || Time.now : nil)
|
23
23
|
end
|
24
24
|
|
25
25
|
define_method attr do
|
data/lib/bool_at/version.rb
CHANGED
data/lib/bool_at.rb
CHANGED
data/spec/bool_at/macro_spec.rb
CHANGED
@@ -36,6 +36,14 @@ RSpec.describe BoolAt::Macro do
|
|
36
36
|
post.published = false
|
37
37
|
expect(post.published?).to be false
|
38
38
|
end
|
39
|
+
|
40
|
+
it "keep time if already set" do
|
41
|
+
past_date = 2.days.ago.to_time
|
42
|
+
post = Post.new(published_at: past_date)
|
43
|
+
post.published = true
|
44
|
+
expect(post.published?).to be true
|
45
|
+
expect(post.published_at).to be past_date
|
46
|
+
end
|
39
47
|
end
|
40
48
|
end
|
41
49
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bool_at
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chong Hui
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -115,10 +115,11 @@ executables: []
|
|
115
115
|
extensions: []
|
116
116
|
extra_rdoc_files: []
|
117
117
|
files:
|
118
|
+
- ".circleci/config.yml"
|
118
119
|
- ".gitignore"
|
119
120
|
- ".rspec"
|
120
121
|
- ".rubocop.yml"
|
121
|
-
-
|
122
|
+
- CHANGELOG.md
|
122
123
|
- CODE_OF_CONDUCT.md
|
123
124
|
- Gemfile
|
124
125
|
- Gemfile.lock
|
@@ -156,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
156
157
|
- !ruby/object:Gem::Version
|
157
158
|
version: '0'
|
158
159
|
requirements: []
|
159
|
-
rubygems_version: 3.
|
160
|
+
rubygems_version: 3.4.10
|
160
161
|
signing_key:
|
161
162
|
specification_version: 4
|
162
163
|
summary: Convert datetime to boolean in ActiveRecord
|
data/.travis.yml
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
sudo: false
|
2
|
-
language: ruby
|
3
|
-
rvm:
|
4
|
-
- 2.5.1
|
5
|
-
- 2.4.1
|
6
|
-
- 2.3.3
|
7
|
-
before_install:
|
8
|
-
- gem update --system
|
9
|
-
- gem --version
|
10
|
-
- gem install bundler
|
11
|
-
cache: bundler
|
12
|
-
script:
|
13
|
-
- bundle exec rspec
|
14
|
-
gemfile:
|
15
|
-
- gemfiles/rails_4.2.gemfile
|
16
|
-
- gemfiles/rails_5.gemfile
|