acts_as_list 0.7.5 → 0.7.6
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 +43 -2
- data/README.md +2 -1
- data/lib/acts_as_list/active_record/acts/list.rb +5 -1
- data/lib/acts_as_list/version.rb +1 -1
- data/test/shared_no_addition.rb +11 -0
- data/test/test_list.rb +16 -0
- 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: ac758ea2c45c36f2da4a70277a4e359e32cbebec
|
4
|
+
data.tar.gz: 44cb219c5932187141cb11cb774e2165b9be86f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32474515db63aa64fea168c43654ebc2d86e24ad5bba2e1e793b0a484ff6d0e40d880c62d559fdf5d830b4213f9ca4a56f5ab776e102daf28e86a1ee1e772dbb
|
7
|
+
data.tar.gz: ab9e2ae5dbe3313a1b69f8cb82019494a10bce07c0343acc88062cd8475774dc2202fa8104cbb156797aae53b87631cabe8766cdf0f627eac7296934ae5dd50b
|
data/CHANGELOG.md
CHANGED
@@ -1,12 +1,53 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
## [
|
3
|
+
## [v0.7.5](https://github.com/swanandp/acts_as_list/tree/v0.7.5) (2016-06-30)
|
4
|
+
[Full Changelog](https://github.com/swanandp/acts_as_list/compare/v0.7.4...v0.7.5)
|
4
5
|
|
5
|
-
|
6
|
+
**Implemented enhancements:**
|
7
|
+
|
8
|
+
- Touch when reordering [\#173](https://github.com/swanandp/acts_as_list/pull/173) ([botandrose](https://github.com/botandrose))
|
6
9
|
|
7
10
|
**Closed issues:**
|
8
11
|
|
12
|
+
- Exception raised when calling destroy "NameError - instance variable @scope\_changed not defined:" [\#206](https://github.com/swanandp/acts_as_list/issues/206)
|
9
13
|
- Undefined instance variable @scope\_changed since 0.7.3 [\#199](https://github.com/swanandp/acts_as_list/issues/199)
|
14
|
+
- Reordering large lists is slow [\#198](https://github.com/swanandp/acts_as_list/issues/198)
|
15
|
+
- Reparenting child leaves gap in source list in rails 5 [\#194](https://github.com/swanandp/acts_as_list/issues/194)
|
16
|
+
- Support rails 5 ? [\#186](https://github.com/swanandp/acts_as_list/issues/186)
|
17
|
+
- 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)
|
18
|
+
- Phenomenon of mysterious value of the position is skipped by one [\#166](https://github.com/swanandp/acts_as_list/issues/166)
|
19
|
+
- Model.find being called twice with acts\_as\_list on destroy [\#161](https://github.com/swanandp/acts_as_list/issues/161)
|
20
|
+
- `scope\_changed?` problem with acts\_as\_paranoid [\#158](https://github.com/swanandp/acts_as_list/issues/158)
|
21
|
+
- Inconsistent behaviour between Symbol and Array scopes [\#155](https://github.com/swanandp/acts_as_list/issues/155)
|
22
|
+
- insert\_at doesn't seem to be working in ActiveRecord callback \(Rails 4.2\) [\#150](https://github.com/swanandp/acts_as_list/issues/150)
|
23
|
+
- Project Documentation link redirects to expired domain [\#149](https://github.com/swanandp/acts_as_list/issues/149)
|
24
|
+
- Problem when updating an position of array of AR objects. [\#137](https://github.com/swanandp/acts_as_list/issues/137)
|
25
|
+
- Unexpected behaviour when inserting consecutive items with default positions [\#124](https://github.com/swanandp/acts_as_list/issues/124)
|
26
|
+
- self.reload prone to error [\#122](https://github.com/swanandp/acts_as_list/issues/122)
|
27
|
+
- Rails 3.0.x in\_list causes the return of default\_scope [\#120](https://github.com/swanandp/acts_as_list/issues/120)
|
28
|
+
- Relationships with dependency:destroy cause ActiveRecord::RecordNotFound [\#118](https://github.com/swanandp/acts_as_list/issues/118)
|
29
|
+
- Using insert\_at with values with type String [\#117](https://github.com/swanandp/acts_as_list/issues/117)
|
30
|
+
- Batch setting of position [\#112](https://github.com/swanandp/acts_as_list/issues/112)
|
31
|
+
- position: 0 now makes model pushed to top? [\#110](https://github.com/swanandp/acts_as_list/issues/110)
|
32
|
+
- Create element in default position [\#103](https://github.com/swanandp/acts_as_list/issues/103)
|
33
|
+
- Enhancement: Expose scope object [\#97](https://github.com/swanandp/acts_as_list/issues/97)
|
34
|
+
- Shuffle list [\#96](https://github.com/swanandp/acts_as_list/issues/96)
|
35
|
+
- Creating an item with a nil scope should not add it to the list [\#92](https://github.com/swanandp/acts_as_list/issues/92)
|
36
|
+
- Performance Improvements [\#88](https://github.com/swanandp/acts_as_list/issues/88)
|
37
|
+
- has\_many :through or has\_many\_and\_belongs\_to\_many support [\#86](https://github.com/swanandp/acts_as_list/issues/86)
|
38
|
+
- ActiveRecord dependency causes rake assets:compile to fail without access to a database [\#84](https://github.com/swanandp/acts_as_list/issues/84)
|
39
|
+
- 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)
|
40
|
+
- Limiting the list size [\#61](https://github.com/swanandp/acts_as_list/issues/61)
|
41
|
+
- Adding multiple creates strange ordering [\#55](https://github.com/swanandp/acts_as_list/issues/55)
|
42
|
+
- Feature: sort [\#26](https://github.com/swanandp/acts_as_list/issues/26)
|
43
|
+
|
44
|
+
**Merged pull requests:**
|
45
|
+
|
46
|
+
- Removed duplicated assignment [\#207](https://github.com/swanandp/acts_as_list/pull/207) ([shunwen](https://github.com/shunwen))
|
47
|
+
- Quote all identifiers [\#205](https://github.com/swanandp/acts_as_list/pull/205) ([fabn](https://github.com/fabn))
|
48
|
+
- Start testing Rails 5 [\#203](https://github.com/swanandp/acts_as_list/pull/203) ([brendon](https://github.com/brendon))
|
49
|
+
- Lock! the record before destroying [\#201](https://github.com/swanandp/acts_as_list/pull/201) ([brendon](https://github.com/brendon))
|
50
|
+
- Fix ambiguous column error when joining some relations [\#180](https://github.com/swanandp/acts_as_list/pull/180) ([natw](https://github.com/natw))
|
10
51
|
|
11
52
|
## [v0.7.4](https://github.com/swanandp/acts_as_list/tree/v0.7.4) (2016-04-15)
|
12
53
|
[Full Changelog](https://github.com/swanandp/acts_as_list/compare/v0.7.3...v0.7.4)
|
data/README.md
CHANGED
@@ -95,6 +95,8 @@ default: '1'. Use this option to define the top of the list. Use 0 to make the c
|
|
95
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.
|
96
96
|
|
97
97
|
## Versions
|
98
|
+
As of version `0.7.5` Rails 5 is supported.
|
99
|
+
|
98
100
|
All versions `0.1.5` onwards require Rails 3.0.x and higher.
|
99
101
|
|
100
102
|
## Build Status
|
@@ -106,7 +108,6 @@ All versions `0.1.5` onwards require Rails 3.0.x and higher.
|
|
106
108
|
## Roadmap
|
107
109
|
|
108
110
|
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
111
|
|
111
112
|
## Contributing to `acts_as_list`
|
112
113
|
|
@@ -77,6 +77,10 @@ module ActiveRecord
|
|
77
77
|
quoted_position_column = connection.quote_column_name(configuration[:column])
|
78
78
|
|
79
79
|
class_eval <<-EOV, __FILE__, __LINE__ + 1
|
80
|
+
def self.acts_as_list_top
|
81
|
+
#{configuration[:top_of_list]}.to_i
|
82
|
+
end
|
83
|
+
|
80
84
|
def acts_as_list_top
|
81
85
|
#{configuration[:top_of_list]}.to_i
|
82
86
|
end
|
@@ -471,7 +475,7 @@ module ActiveRecord
|
|
471
475
|
send('decrement_positions_on_lower_items') if lower_item
|
472
476
|
cached_changes.each { |attribute, values| self[attribute] = values[1] }
|
473
477
|
|
474
|
-
send("add_to_list_#{add_new_at}")
|
478
|
+
send("add_to_list_#{add_new_at}") if add_new_at.present?
|
475
479
|
end
|
476
480
|
end
|
477
481
|
|
data/lib/acts_as_list/version.rb
CHANGED
data/test/shared_no_addition.rb
CHANGED
@@ -21,5 +21,16 @@ module Shared
|
|
21
21
|
assert !new.in_list?
|
22
22
|
end
|
23
23
|
|
24
|
+
def test_update_scope_does_not_add_to_list
|
25
|
+
new = NoAdditionMixin.create
|
26
|
+
|
27
|
+
new.update_attribute(:parent_id, 20)
|
28
|
+
new.reload
|
29
|
+
assert !new.in_list?
|
30
|
+
|
31
|
+
new.update_attribute(:parent_id, 5)
|
32
|
+
new.reload
|
33
|
+
assert !new.in_list?
|
34
|
+
end
|
24
35
|
end
|
25
36
|
end
|
data/test/test_list.rb
CHANGED
@@ -691,3 +691,19 @@ class TouchTest < ActsAsListTestCase
|
|
691
691
|
end
|
692
692
|
end
|
693
693
|
end
|
694
|
+
|
695
|
+
class ActsAsListTopTest < ActsAsListTestCase
|
696
|
+
def setup
|
697
|
+
setup_db
|
698
|
+
end
|
699
|
+
|
700
|
+
def test_acts_as_list_top
|
701
|
+
assert_equal 1, TheBaseSubclass.new.acts_as_list_top
|
702
|
+
assert_equal 0, ZeroBasedMixin.new.acts_as_list_top
|
703
|
+
end
|
704
|
+
|
705
|
+
def test_class_acts_as_list_top
|
706
|
+
assert_equal 1, TheBaseSubclass.acts_as_list_top
|
707
|
+
assert_equal 0, ZeroBasedMixin.acts_as_list_top
|
708
|
+
end
|
709
|
+
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.7.
|
4
|
+
version: 0.7.6
|
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: 2016-
|
13
|
+
date: 2016-07-15 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|