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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 98f6fd7ba59d678e9515fb6df58506d12ac6c867
4
- data.tar.gz: 75c8faf4b37f45f8e9141dd689fef822e5ab015f
3
+ metadata.gz: 5389d6284e204b5d24d21e0059706dfca2f6ffb4
4
+ data.tar.gz: 8c70ec4d0148e815bd1261a2ab29db12dc7c1446
5
5
  SHA512:
6
- metadata.gz: 4e4b58ebd54bfe29269d18f185cc7c1976c94d6b08bac50488ad6fae17405f51dbb4850949c265548d754badb555d11eaabe2833c517119093e12ba424c5aded
7
- data.tar.gz: f42fbba52c1da889010233b2d5df4005bb7d0f15e2b8222253a800af2c4ca882c344f8d36b4bf5df6ac875fb64ec40453f195fc9c4bbbaa996c8e6db75d15b5a
6
+ metadata.gz: 9612ad3b4bf5ba60f8ff652acac46905c384349b2c63521b36a90ef11e24e1342db72bcded83fc6b1eb9944b37c5297a799460068f2c445a3adaf256930b70dd
7
+ data.tar.gz: a0efb9b5b14c53871437c4562a2ff073d7ad7088c896aaccb2a43c2ab7cacf86d4447c871f9af7dcdab2fa21f6f2e994fa61871aa262a4d1544e878e7e3eace6
@@ -1,14 +1,18 @@
1
1
  # Change Log
2
2
 
3
- ## [Unreleased](https://github.com/swanandp/acts_as_list/tree/HEAD)
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
- conditions = except ? "#{quoted_table_name}.#{self.class.primary_key} != #{self.class.connection.quote(except.id)}" : {}
272
- acts_as_list_list.in_list.where(
273
- conditions
274
- ).order(
275
- "#{quoted_position_column_with_table_name} DESC"
276
- ).first
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} != ?", self.class.connection.quote(avoid_id))
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} != ?", self.class.connection.quote(avoid_id))
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
@@ -1,7 +1,7 @@
1
1
  module ActiveRecord
2
2
  module Acts
3
3
  module List
4
- VERSION = '0.9.1'
4
+ VERSION = '0.9.2'
5
5
  end
6
6
  end
7
7
  end
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.1
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-01-26 00:00:00.000000000 Z
13
+ date: 2017-02-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord