active_record-acts_as 2.4.0 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/lib/active_record/acts_as/querying.rb +1 -1
- data/lib/active_record/acts_as/version.rb +1 -1
- data/spec/acts_as_spec.rb +17 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0bbaf8a07eceb6c10fd9e9fea3ece8a641aef69
|
4
|
+
data.tar.gz: c5c9b6265ca7464402b6cf8955c28345deee417d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 195e8c8b7c28634bb882fdcd693341a2eb8bdad0092c1a43fda14414a55da85dda79b2b04ad5d8bd651e622a7380bc5731a082f9d996aa156968bba316639e64
|
7
|
+
data.tar.gz: 5daea8a73f30a50e7471bbf521a00dbb9313576ec508ba518f24508c1a5262a28dfcae98acb6c389e05da2ed540dce7d5b091452f25444a8b687efae75c895e7
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
6
6
|
|
7
|
+
## [2.4.1] - 2017-04-19
|
8
|
+
### Fixed
|
9
|
+
- Make ActiveRecord::Relation#where! work.
|
10
|
+
|
7
11
|
## [2.4.0] - 2017-04-16
|
8
12
|
### Changed
|
9
13
|
- Don't make all supermodel class methods callable by submodel, only scopes. Add `callable_by_submodel` to supermodel so users can make their own class methods callable by submodels.
|
@@ -84,7 +88,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
84
88
|
### Fixed
|
85
89
|
- Fixed `remove_actable` migration helper (https://github.com/hzamani/active_record-acts_as/pull/71, thanks to [nuclearpidgeon](https://github.com/nuclearpidgeon)!)
|
86
90
|
|
87
|
-
[Unreleased]: https://github.com/krautcomputing/active_record-acts_as/compare/v2.4.
|
91
|
+
[Unreleased]: https://github.com/krautcomputing/active_record-acts_as/compare/v2.4.1...HEAD
|
92
|
+
[2.4.1]: https://github.com/krautcomputing/active_record-acts_as/compare/v2.4.0...v2.4.1
|
88
93
|
[2.4.0]: https://github.com/krautcomputing/active_record-acts_as/compare/v2.3.1...v2.4.0
|
89
94
|
[2.3.1]: https://github.com/krautcomputing/active_record-acts_as/compare/v2.3.0...v2.3.1
|
90
95
|
[2.3.0]: https://github.com/krautcomputing/active_record-acts_as/compare/v2.2.1...v2.3.0
|
data/spec/acts_as_spec.rb
CHANGED
@@ -443,22 +443,30 @@ RSpec.describe "ActiveRecord::Base model with #acts_as called" do
|
|
443
443
|
before(:each) { clear_database }
|
444
444
|
|
445
445
|
it "respects supermodel attributes in .where" do
|
446
|
-
red_pen
|
447
|
-
blue_pen
|
446
|
+
red_pen = Pen.create(name: 'red pen', price: 0.8, color: 'red')
|
447
|
+
blue_pen = Pen.create(name: 'blue pen', price: 0.8, color: 'blue')
|
448
448
|
black_pen = Pen.create(name: 'black pen', price: 0.9, color: 'black')
|
449
449
|
|
450
|
-
expect
|
451
|
-
|
452
|
-
|
450
|
+
expect(Pen.where(price: 0.8).to_a).to eq([red_pen, blue_pen])
|
451
|
+
end
|
452
|
+
|
453
|
+
it "respects supermodel attributes in .where!" do
|
454
|
+
red_pen = Pen.create(name: 'red pen', price: 0.8, color: 'red')
|
455
|
+
blue_pen = Pen.create(name: 'blue pen', price: 0.8, color: 'blue')
|
456
|
+
black_pen = Pen.create(name: 'black pen', price: 0.9, color: 'black')
|
457
|
+
|
458
|
+
relation = Pen.all
|
459
|
+
relation.where!(price: 0.8)
|
460
|
+
expect(relation.to_a).to eq([red_pen, blue_pen])
|
453
461
|
end
|
454
462
|
|
455
463
|
it "respects supermodel attributes in .find_by" do
|
456
|
-
red_pen
|
457
|
-
blue_pen
|
464
|
+
red_pen = Pen.create(name: 'red pen', price: 0.8, color: 'red')
|
465
|
+
blue_pen = Pen.create(name: 'blue pen', price: 0.8, color: 'blue')
|
458
466
|
black_pen = Pen.create(name: 'black pen', price: 0.9, color: 'black')
|
459
467
|
|
460
|
-
expect(Pen.find_by(name: 'red pen')).to
|
461
|
-
expect(Pen.find_by(name: 'blue pen')).to
|
468
|
+
expect(Pen.find_by(name: 'red pen')).to eq(red_pen)
|
469
|
+
expect(Pen.find_by(name: 'blue pen')).to eq(blue_pen)
|
462
470
|
expect(Pen.find_by(name: 'black pen')).to eq(black_pen)
|
463
471
|
end
|
464
472
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_record-acts_as
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hassan Zamani
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-04-
|
12
|
+
date: 2017-04-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sqlite3
|