acts_as_list 0.9.1 → 0.9.2
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 +7 -3
- data/lib/acts_as_list/active_record/acts/list.rb +9 -8
- data/lib/acts_as_list/version.rb +1 -1
- 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: 5389d6284e204b5d24d21e0059706dfca2f6ffb4
|
4
|
+
data.tar.gz: 8c70ec4d0148e815bd1261a2ab29db12dc7c1446
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9612ad3b4bf5ba60f8ff652acac46905c384349b2c63521b36a90ef11e24e1342db72bcded83fc6b1eb9944b37c5297a799460068f2c445a3adaf256930b70dd
|
7
|
+
data.tar.gz: a0efb9b5b14c53871437c4562a2ff073d7ad7088c896aaccb2a43c2ab7cacf86d4447c871f9af7dcdab2fa21f6f2e994fa61871aa262a4d1544e878e7e3eace6
|
data/CHANGELOG.md
CHANGED
@@ -1,14 +1,18 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
## [
|
4
|
-
|
5
|
-
[Full Changelog](https://github.com/swanandp/acts_as_list/compare/v0.9.0...HEAD)
|
3
|
+
## [v0.9.1](https://github.com/swanandp/acts_as_list/tree/v0.9.1) (2017-01-26)
|
4
|
+
[Full Changelog](https://github.com/swanandp/acts_as_list/compare/v0.9.0...v0.9.1)
|
6
5
|
|
7
6
|
**Closed issues:**
|
8
7
|
|
8
|
+
- DEPRECATION WARNING on rails 5.0 as of acts\_as\_list 0.9 [\#251](https://github.com/swanandp/acts_as_list/issues/251)
|
9
9
|
- highter\_items returns items with the same position value [\#247](https://github.com/swanandp/acts_as_list/issues/247)
|
10
10
|
- Broken with unique constraint on position [\#245](https://github.com/swanandp/acts_as_list/issues/245)
|
11
11
|
|
12
|
+
**Merged pull requests:**
|
13
|
+
|
14
|
+
- fixes \#251 table\_exists? deprecation warning with Rails 5.0 [\#252](https://github.com/swanandp/acts_as_list/pull/252) ([zharikovpro](https://github.com/zharikovpro))
|
15
|
+
|
12
16
|
## [v0.9.0](https://github.com/swanandp/acts_as_list/tree/v0.9.0) (2017-01-23)
|
13
17
|
[Full Changelog](https://github.com/swanandp/acts_as_list/compare/v0.8.2...v0.9.0)
|
14
18
|
|
@@ -268,12 +268,13 @@ module ActiveRecord
|
|
268
268
|
|
269
269
|
# Returns the bottom item
|
270
270
|
def bottom_item(except = nil)
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
271
|
+
scope = acts_as_list_list
|
272
|
+
|
273
|
+
if except
|
274
|
+
scope = scope.where("#{quoted_table_name}.#{self.class.primary_key} != ?", except.id)
|
275
|
+
end
|
276
|
+
|
277
|
+
scope.in_list.order("#{quoted_position_column_with_table_name} DESC").first
|
277
278
|
end
|
278
279
|
|
279
280
|
# Forces item to assume the bottom position in the list.
|
@@ -297,7 +298,7 @@ module ActiveRecord
|
|
297
298
|
scope = acts_as_list_list
|
298
299
|
|
299
300
|
if avoid_id
|
300
|
-
scope = scope.where("#{quoted_table_name}.#{self.class.primary_key} != ?",
|
301
|
+
scope = scope.where("#{quoted_table_name}.#{self.class.primary_key} != ?", avoid_id)
|
301
302
|
end
|
302
303
|
|
303
304
|
scope.where("#{quoted_position_column_with_table_name} >= ?", position).increment_all
|
@@ -330,7 +331,7 @@ module ActiveRecord
|
|
330
331
|
scope = acts_as_list_list
|
331
332
|
|
332
333
|
if avoid_id
|
333
|
-
scope = scope.where("#{quoted_table_name}.#{self.class.primary_key} != ?",
|
334
|
+
scope = scope.where("#{quoted_table_name}.#{self.class.primary_key} != ?", avoid_id)
|
334
335
|
end
|
335
336
|
|
336
337
|
if old_position < new_position
|
data/lib/acts_as_list/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_list
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-
|
13
|
+
date: 2017-02-07 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|