acts_as_list 0.7.4 → 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ODI0OTU2NzgzMmY0MmI3YjMyMDk2ZDg5YWJjNjkxZDE4ZjViODliYQ==
5
- data.tar.gz: !binary |-
6
- OThlMWNiYjU3MGRmMGQzNjA5NzQ1MDk1MzdiYTg1MGFjODJlNDJmYQ==
2
+ SHA1:
3
+ metadata.gz: 5b311fb3c5f9b0839f22ff361020142db9c63045
4
+ data.tar.gz: 7600388596e829712e8936f9a31b70008ee7d18b
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- ZDMzOWRkNzQ2ZjNmZGRlM2QxYzJkN2VjYzM2MGY1Yzk4MjE1MmZiOWQyZjY1
10
- NmY4Y2FjY2U4YjczNjliZjFmYzYwYmMzYTNlNTA2MjU4NmVlODFmMzg1NGY0
11
- OWNkN2Y4MGU2ZTM4YjM2YjY0MTZkNjcwMjk0NmQ1YzBkMmNjYjE=
12
- data.tar.gz: !binary |-
13
- Mzg4NGQwNmY2NjdjN2MxZWIzYWE4MWNiOTlkMTc5NGM5NTRiMzRmY2MwNDVh
14
- ODI2YTVhZmUwMzE1OTAwNzA1OWZjMjc3ZGNhZmI1Y2ZmNmU4NmYzNGQ3ZTc1
15
- OGUyZDE0NjZkZTVjNmQxZTJhOWUyNjdhOWIwMjJiMTg2YzA2NWI=
6
+ metadata.gz: dc169373691b7a79c44393a368f4f589b04462c341f8f423f7eeedf846f29346dd3c6821f618287244a24ceafe04ebe416b4c6b6704f0be8470e69a1cd098a76
7
+ data.tar.gz: 748929065353ef8d675953d0469a4bd26ec8aee6921edfe6710b97186b25f75abc4a57bd648a2b076923cf5283e6dafb225ba0e6596efd21b23734897adc2f66
data/.gitignore CHANGED
@@ -9,3 +9,4 @@ pkg/*
9
9
  .ruby-version
10
10
  # Appraisal generated lockfiles
11
11
  *.gemfile.lock
12
+ .DS_Store
data/.travis.yml CHANGED
@@ -9,9 +9,24 @@ rvm:
9
9
  - 1.9.3
10
10
  - 2.0.0
11
11
  - 2.1.0
12
+ - 2.2.2
12
13
  - jruby-19mode
13
14
  - rbx-2
14
15
  gemfile:
15
16
  - gemfiles/rails_3_2.gemfile
16
17
  - gemfiles/rails_4_1.gemfile
17
18
  - gemfiles/rails_4_2.gemfile
19
+ - gemfiles/rails_5_0.gemfile
20
+ matrix:
21
+ exclude:
22
+ - rvm: 1.9.3
23
+ gemfile: gemfiles/rails_5_0.gemfile
24
+ - rvm: 2.0.0
25
+ gemfile: gemfiles/rails_5_0.gemfile
26
+ - rvm: 2.1.0
27
+ gemfile: gemfiles/rails_5_0.gemfile
28
+ - rvm: jruby-19mode
29
+ gemfile: gemfiles/rails_5_0.gemfile
30
+ - rvm: rbx-2
31
+ gemfile: gemfiles/rails_5_0.gemfile
32
+
data/Appraisals CHANGED
@@ -1,11 +1,21 @@
1
1
  appraise "rails-3-2" do
2
- gem "activerecord", "~> 3.2.21"
2
+ gem "activerecord", "~> 3.2.22.2"
3
+ group :test do
4
+ gem "after_commit_exception_notification"
5
+ end
3
6
  end
4
7
 
5
8
  appraise "rails-4-1" do
6
- gem "activerecord", "~> 4.1.10"
9
+ gem "activerecord", "~> 4.1.16"
10
+ group :test do
11
+ gem "after_commit_exception_notification"
12
+ end
7
13
  end
8
14
 
9
15
  appraise "rails-4-2" do
10
- gem "activerecord", "~> 4.2.1"
16
+ gem "activerecord", "~> 4.2.7"
17
+ end
18
+
19
+ appraise "rails-5-0" do
20
+ gem "activerecord", "~> 5.0.0"
11
21
  end
data/CHANGELOG.md CHANGED
@@ -1,7 +1,122 @@
1
1
  # Change Log
2
2
 
3
+ ## [v0.8.1](https://github.com/swanandp/acts_as_list/tree/v0.8.1) (2016-09-06)
4
+ [Full Changelog](https://github.com/swanandp/acts_as_list/compare/v0.8.0...v0.8.1)
5
+
6
+ **Closed issues:**
7
+
8
+ - Rubinius Intermittent testing error [\#218](https://github.com/swanandp/acts_as_list/issues/218)
9
+ - ActiveRecord dependency causes rake assets:compile to fail without access to a database [\#84](https://github.com/swanandp/acts_as_list/issues/84)
10
+
11
+ **Merged pull requests:**
12
+
13
+ - Refactor class\_eval with string into class\_eval with block [\#215](https://github.com/swanandp/acts_as_list/pull/215) ([rdvdijk](https://github.com/rdvdijk))
14
+
15
+ ## [v0.8.0](https://github.com/swanandp/acts_as_list/tree/v0.8.0) (2016-08-23)
16
+ [Full Changelog](https://github.com/swanandp/acts_as_list/compare/v0.7.7...v0.8.0)
17
+
18
+ **Closed issues:**
19
+
20
+ - Behavior with DB default seems unclear [\#219](https://github.com/swanandp/acts_as_list/issues/219)
21
+
22
+ **Merged pull requests:**
23
+
24
+ - No longer a need specify additional rbx gems [\#225](https://github.com/swanandp/acts_as_list/pull/225) ([brendon](https://github.com/brendon))
25
+ - Fix position when no serial positions [\#223](https://github.com/swanandp/acts_as_list/pull/223) ([jpalumickas](https://github.com/jpalumickas))
26
+ - Bug: Specifying a position with add\_new\_at: :top fails to insert at that position [\#220](https://github.com/swanandp/acts_as_list/pull/220) ([brendon](https://github.com/brendon))
27
+
28
+ ## [v0.7.7](https://github.com/swanandp/acts_as_list/tree/v0.7.7) (2016-08-18)
29
+ [Full Changelog](https://github.com/swanandp/acts_as_list/compare/v0.7.6...v0.7.7)
30
+
31
+ **Closed issues:**
32
+
33
+ - Issue after upgrading to 0.7.5: No connection pool with id primary found. [\#214](https://github.com/swanandp/acts_as_list/issues/214)
34
+ - Changing scope is inconsistent based on add\_new\_at [\#138](https://github.com/swanandp/acts_as_list/issues/138)
35
+ - Duplicate positions and lost items [\#76](https://github.com/swanandp/acts_as_list/issues/76)
36
+
37
+ **Merged pull requests:**
38
+
39
+ - Add quoted table names to some columns [\#221](https://github.com/swanandp/acts_as_list/pull/221) ([jpalumickas](https://github.com/jpalumickas))
40
+ - Appraisals cleanup [\#217](https://github.com/swanandp/acts_as_list/pull/217) ([brendon](https://github.com/brendon))
41
+ - Fix insert\_at\_position in race condition [\#195](https://github.com/swanandp/acts_as_list/pull/195) ([danielross](https://github.com/danielross))
42
+
43
+ ## [v0.7.6](https://github.com/swanandp/acts_as_list/tree/v0.7.6) (2016-07-15)
44
+ [Full Changelog](https://github.com/swanandp/acts_as_list/compare/v0.7.5...v0.7.6)
45
+
46
+ **Closed issues:**
47
+
48
+ - add\_new\_at nil with scope causes NoMethodError [\#211](https://github.com/swanandp/acts_as_list/issues/211)
49
+
50
+ **Merged pull requests:**
51
+
52
+ - Add class method acts\_as\_list\_top as reader for configured top\_of\_list [\#213](https://github.com/swanandp/acts_as_list/pull/213) ([krzysiek1507](https://github.com/krzysiek1507))
53
+ - Bugfix/add new at nil on scope change [\#212](https://github.com/swanandp/acts_as_list/pull/212) ([greatghoul](https://github.com/greatghoul))
54
+
55
+ ## [v0.7.5](https://github.com/swanandp/acts_as_list/tree/v0.7.5) (2016-06-30)
56
+ [Full Changelog](https://github.com/swanandp/acts_as_list/compare/v0.7.4...v0.7.5)
57
+
58
+ **Implemented enhancements:**
59
+
60
+ - Touch when reordering [\#173](https://github.com/swanandp/acts_as_list/pull/173) ([botandrose](https://github.com/botandrose))
61
+
62
+ **Closed issues:**
63
+
64
+ - Exception raised when calling destroy "NameError - instance variable @scope\_changed not defined:" [\#206](https://github.com/swanandp/acts_as_list/issues/206)
65
+ - Undefined instance variable @scope\_changed since 0.7.3 [\#199](https://github.com/swanandp/acts_as_list/issues/199)
66
+ - Reordering large lists is slow [\#198](https://github.com/swanandp/acts_as_list/issues/198)
67
+ - Reparenting child leaves gap in source list in rails 5 [\#194](https://github.com/swanandp/acts_as_list/issues/194)
68
+ - Support rails 5 ? [\#186](https://github.com/swanandp/acts_as_list/issues/186)
69
+ - I get a NoMethodError: undefined method `acts\_as\_list' when trying to include acts\_as\_list [\#176](https://github.com/swanandp/acts_as_list/issues/176)
70
+ - Phenomenon of mysterious value of the position is skipped by one [\#166](https://github.com/swanandp/acts_as_list/issues/166)
71
+ - Model.find being called twice with acts\_as\_list on destroy [\#161](https://github.com/swanandp/acts_as_list/issues/161)
72
+ - `scope\_changed?` problem with acts\_as\_paranoid [\#158](https://github.com/swanandp/acts_as_list/issues/158)
73
+ - Inconsistent behaviour between Symbol and Array scopes [\#155](https://github.com/swanandp/acts_as_list/issues/155)
74
+ - insert\_at doesn't seem to be working in ActiveRecord callback \(Rails 4.2\) [\#150](https://github.com/swanandp/acts_as_list/issues/150)
75
+ - Project Documentation link redirects to expired domain [\#149](https://github.com/swanandp/acts_as_list/issues/149)
76
+ - Problem when updating an position of array of AR objects. [\#137](https://github.com/swanandp/acts_as_list/issues/137)
77
+ - Unexpected behaviour when inserting consecutive items with default positions [\#124](https://github.com/swanandp/acts_as_list/issues/124)
78
+ - self.reload prone to error [\#122](https://github.com/swanandp/acts_as_list/issues/122)
79
+ - Rails 3.0.x in\_list causes the return of default\_scope [\#120](https://github.com/swanandp/acts_as_list/issues/120)
80
+ - Relationships with dependency:destroy cause ActiveRecord::RecordNotFound [\#118](https://github.com/swanandp/acts_as_list/issues/118)
81
+ - Using insert\_at with values with type String [\#117](https://github.com/swanandp/acts_as_list/issues/117)
82
+ - Batch setting of position [\#112](https://github.com/swanandp/acts_as_list/issues/112)
83
+ - position: 0 now makes model pushed to top? [\#110](https://github.com/swanandp/acts_as_list/issues/110)
84
+ - Create element in default position [\#103](https://github.com/swanandp/acts_as_list/issues/103)
85
+ - Enhancement: Expose scope object [\#97](https://github.com/swanandp/acts_as_list/issues/97)
86
+ - Shuffle list [\#96](https://github.com/swanandp/acts_as_list/issues/96)
87
+ - Creating an item with a nil scope should not add it to the list [\#92](https://github.com/swanandp/acts_as_list/issues/92)
88
+ - Performance Improvements [\#88](https://github.com/swanandp/acts_as_list/issues/88)
89
+ - has\_many :through or has\_many\_and\_belongs\_to\_many support [\#86](https://github.com/swanandp/acts_as_list/issues/86)
90
+ - move\_higher/move\_lower vs move\_to\_top/move\_to\_bottom act differently when item is already at top or bottom [\#77](https://github.com/swanandp/acts_as_list/issues/77)
91
+ - Limiting the list size [\#61](https://github.com/swanandp/acts_as_list/issues/61)
92
+ - Adding multiple creates strange ordering [\#55](https://github.com/swanandp/acts_as_list/issues/55)
93
+ - Feature: sort [\#26](https://github.com/swanandp/acts_as_list/issues/26)
94
+
95
+ **Merged pull requests:**
96
+
97
+ - Fix position when no serial positions [\#208](https://github.com/swanandp/acts_as_list/pull/208) ([PoslinskiNet](https://github.com/PoslinskiNet))
98
+ - Removed duplicated assignment [\#207](https://github.com/swanandp/acts_as_list/pull/207) ([shunwen](https://github.com/shunwen))
99
+ - Quote all identifiers [\#205](https://github.com/swanandp/acts_as_list/pull/205) ([fabn](https://github.com/fabn))
100
+ - Start testing Rails 5 [\#203](https://github.com/swanandp/acts_as_list/pull/203) ([brendon](https://github.com/brendon))
101
+ - Lock! the record before destroying [\#201](https://github.com/swanandp/acts_as_list/pull/201) ([brendon](https://github.com/brendon))
102
+ - Fix ambiguous column error when joining some relations [\#180](https://github.com/swanandp/acts_as_list/pull/180) ([natw](https://github.com/natw))
103
+
104
+ ## [v0.7.4](https://github.com/swanandp/acts_as_list/tree/v0.7.4) (2016-04-15)
105
+ [Full Changelog](https://github.com/swanandp/acts_as_list/compare/v0.7.3...v0.7.4)
106
+
107
+ **Closed issues:**
108
+
109
+ - Releasing a new gem version [\#196](https://github.com/swanandp/acts_as_list/issues/196)
110
+
111
+ **Merged pull requests:**
112
+
113
+ - Fix scope changed [\#200](https://github.com/swanandp/acts_as_list/pull/200) ([brendon](https://github.com/brendon))
114
+
3
115
  ## [v0.7.3](https://github.com/swanandp/acts_as_list/tree/v0.7.3) (2016-04-14)
4
- [Full Changelog](https://github.com/swanandp/acts_as_list/compare/0.7.1...v0.7.3)
116
+ [Full Changelog](https://github.com/swanandp/acts_as_list/compare/v0.7.2...v0.7.3)
117
+
118
+ ## [v0.7.2](https://github.com/swanandp/acts_as_list/tree/v0.7.2) (2016-04-01)
119
+ [Full Changelog](https://github.com/swanandp/acts_as_list/compare/0.7.2...v0.7.2)
5
120
 
6
121
  **Closed issues:**
7
122
 
@@ -238,4 +353,4 @@
238
353
 
239
354
 
240
355
 
241
- \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
356
+ \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
data/Gemfile CHANGED
@@ -3,21 +3,15 @@ source "http://rubygems.org"
3
3
  gem "sqlite3", platforms: [:ruby]
4
4
  gem "activerecord-jdbcsqlite3-adapter", platforms: [:jruby]
5
5
 
6
- platforms :rbx do
7
- gem "rubysl", "~> 2.0"
8
- gem "rubinius-developer_tools"
9
- gem "rubysl-test-unit"
10
- end
6
+ gem "rack", "~> 1", platforms: [:ruby_19, :ruby_20, :ruby_21, :jruby]
11
7
 
12
- # Specify your gem"s dependencies in acts_as_list-rails3.gemspec
13
8
  gemspec
14
9
 
15
10
  gem "rake"
16
11
  gem "appraisal"
17
- # Used to automatically generate changelog file
18
12
  gem "github_changelog_generator", "1.9.0"
19
13
 
20
14
  group :test do
21
- gem "minitest", "~> 5.0"
15
+ gem "minitest", "~> 5.0"
22
16
  gem "test_after_commit", "~> 0.4.2"
23
17
  end
data/README.md CHANGED
@@ -4,6 +4,13 @@
4
4
 
5
5
  This `acts_as` extension provides the capabilities for sorting and reordering a number of objects in a list. The class that has this specified needs to have a `position` column defined as an integer on the mapped database table.
6
6
 
7
+ ## 0.8.0 Upgrade Notes
8
+
9
+ There are a couple of changes of behaviour from `0.8.0` onwards:
10
+
11
+ - If you specify `add_new_at: :top`, new items will be added to the top of the list like always. But now, if you specify a position at insert time: `.create(position: 3)`, the position will be respected. In this example, the item will end up at position `3` and will move other items further down the list. Before `0.8.0` the position would be ignored and the item would still be added to the top of the list. [#220](https://github.com/swanandp/acts_as_list/pull/220)
12
+ - `acts_as_list` now copes with disparate position integers (i.e. gaps between the numbers). There has been a change in behaviour for the `higher_items` method. It now returns items with the first item in the collection being the closest item to the reference item, and the last item in the collection being the furthest from the reference item (a.k.a. the first item in the list). [#223](https://github.com/swanandp/acts_as_list/pull/223)
13
+
7
14
  ## Installation
8
15
 
9
16
  In your Gemfile:
@@ -71,8 +78,6 @@ In `acts_as_list`, "higher" means further up the list (a lower `position`), and
71
78
  - `list_item.lower_items` will return all the items below `list_item` in the list (ordered by the position, ascending)
72
79
 
73
80
  ## Notes
74
- If the `position` column has a default value, then there is a slight change in behavior, i.e if you have 4 items in the list, and you insert 1, with a default position 0, it would be pushed to the bottom of the list. Please look at the tests for this and some recent pull requests for discussions related to this.
75
-
76
81
  All `position` queries (select, update, etc.) inside gem methods are executed without the default scope (i.e. `Model.unscoped`), this will prevent nasty issues when the default scope is different from `acts_as_list` scope.
77
82
 
78
83
  The `position` column is set after validations are called, so you should not put a `presence` validation on the `position` column.
@@ -88,13 +93,15 @@ end
88
93
 
89
94
  ## More Options
90
95
  - `column`
91
- default: 'position'. Use this option if the column name in your database is different from position.
96
+ default: `position`. Use this option if the column name in your database is different from position.
92
97
  - `top_of_list`
93
- default: '1'. Use this option to define the top of the list. Use 0 to make the collection act more like an array in its indexing.
98
+ default: `1`. Use this option to define the top of the list. Use 0 to make the collection act more like an array in its indexing.
94
99
  - `add_new_at`
95
- default: ':bottom'. Use this option to specify whether objects get added to the :top or :bottom of the list. `nil` will result in new items not being added to the list on create, i.e, position will be kept nil after create.
100
+ default: `:bottom`. Use this option to specify whether objects get added to the `:top` or `:bottom` of the list. `nil` will result in new items not being added to the list on create, i.e, position will be kept nil after create.
96
101
 
97
102
  ## Versions
103
+ As of version `0.7.5` Rails 5 is supported.
104
+
98
105
  All versions `0.1.5` onwards require Rails 3.0.x and higher.
99
106
 
100
107
  ## Build Status
@@ -106,7 +113,6 @@ All versions `0.1.5` onwards require Rails 3.0.x and higher.
106
113
  ## Roadmap
107
114
 
108
115
  1. Sort based feature
109
- 2. Rails 4 compatibility and bye bye Rails 2! Older versions would of course continue to work with Rails 2, but there won't be any support on those.
110
116
 
111
117
  ## Contributing to `acts_as_list`
112
118
 
@@ -4,10 +4,11 @@ source "http://rubygems.org"
4
4
 
5
5
  gem "sqlite3", :platforms => [:ruby]
6
6
  gem "activerecord-jdbcsqlite3-adapter", :platforms => [:jruby]
7
+ gem "rack", "~> 1", :platforms => [:ruby_19, :ruby_20, :ruby_21, :jruby]
7
8
  gem "rake"
8
9
  gem "appraisal"
9
10
  gem "github_changelog_generator", "1.9.0"
10
- gem "activerecord", "~> 3.2.21"
11
+ gem "activerecord", "~> 3.2.22.2"
11
12
 
12
13
  group :test do
13
14
  gem "minitest", "~> 5.0"
@@ -15,10 +16,4 @@ group :test do
15
16
  gem "after_commit_exception_notification"
16
17
  end
17
18
 
18
- platforms :rbx do
19
- gem "rubysl", "~> 2.0"
20
- gem "rubinius-developer_tools"
21
- gem "rubysl-test-unit"
22
- end
23
-
24
19
  gemspec :path => "../"
@@ -4,10 +4,11 @@ source "http://rubygems.org"
4
4
 
5
5
  gem "sqlite3", :platforms => [:ruby]
6
6
  gem "activerecord-jdbcsqlite3-adapter", :platforms => [:jruby]
7
+ gem "rack", "~> 1", :platforms => [:ruby_19, :ruby_20, :ruby_21, :jruby]
7
8
  gem "rake"
8
9
  gem "appraisal"
9
10
  gem "github_changelog_generator", "1.9.0"
10
- gem "activerecord", "~> 4.1.10"
11
+ gem "activerecord", "~> 4.1.16"
11
12
 
12
13
  group :test do
13
14
  gem "minitest", "~> 5.0"
@@ -15,10 +16,4 @@ group :test do
15
16
  gem "after_commit_exception_notification"
16
17
  end
17
18
 
18
- platforms :rbx do
19
- gem "rubysl", "~> 2.0"
20
- gem "rubinius-developer_tools"
21
- gem "rubysl-test-unit"
22
- end
23
-
24
19
  gemspec :path => "../"
@@ -4,20 +4,15 @@ source "http://rubygems.org"
4
4
 
5
5
  gem "sqlite3", :platforms => [:ruby]
6
6
  gem "activerecord-jdbcsqlite3-adapter", :platforms => [:jruby]
7
+ gem "rack", "~> 1", :platforms => [:ruby_19, :ruby_20, :ruby_21, :jruby]
7
8
  gem "rake"
8
9
  gem "appraisal"
9
10
  gem "github_changelog_generator", "1.9.0"
10
- gem "activerecord", "~> 4.2.1"
11
+ gem "activerecord", "~> 4.2.7"
11
12
 
12
13
  group :test do
13
14
  gem "minitest", "~> 5.0"
14
15
  gem "test_after_commit", "~> 0.4.2"
15
16
  end
16
17
 
17
- platforms :rbx do
18
- gem "rubysl", "~> 2.0"
19
- gem "rubinius-developer_tools"
20
- gem "rubysl-test-unit"
21
- end
22
-
23
18
  gemspec :path => "../"
@@ -0,0 +1,18 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "sqlite3", :platforms => [:ruby]
6
+ gem "activerecord-jdbcsqlite3-adapter", :platforms => [:jruby]
7
+ gem "rack", "~> 1", :platforms => [:ruby_19, :ruby_20, :ruby_21, :jruby]
8
+ gem "rake"
9
+ gem "appraisal"
10
+ gem "github_changelog_generator", "1.9.0"
11
+ gem "activerecord", "~> 5.0.0"
12
+
13
+ group :test do
14
+ gem "minitest", "~> 5.0"
15
+ gem "test_after_commit", "~> 0.4.2"
16
+ end
17
+
18
+ gemspec :path => "../"