acts_as_list 0.9.15 → 0.9.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a9a0291b66db99525acb7519c4f07f6213807fab
4
- data.tar.gz: 2bd62327801108c1b2e352b60334457a2c61f5ec
3
+ metadata.gz: 370205f3c55e44c0633e2aabc665fa4489bf4e4c
4
+ data.tar.gz: 2ce434302042df344231d3b8cb4fc053ba2c39af
5
5
  SHA512:
6
- metadata.gz: 712b360a8fd332f72fd8ecc3df598f0bdc42d048a14c2662e26f0001af55dbb0c75848cfec246ac2f446eaff3152d7007fc5b7234464b27d4cebda202223e44e
7
- data.tar.gz: cc181d9cd3b8644796aebe0ce6e09ebf166fc89970c5617bd56c968a19ac18c3c97f5e8a60d78ac39011b74ab9e09804414844eb18e191052bb3bc9f8a082adb
6
+ metadata.gz: 4bc4009e669c92bc3822baa35d9560c54d66cd32ef950fad5f2c0f1ff1f6f04cc5d3f747265fc1a7462bf0118ba917aff33256dde5037cfa2398dbe34f6e140b
7
+ data.tar.gz: 6ee14901baf239084f2c31fa89e63d50b92e6de9113f91cecb3db18f0dae751cbfd50eb5578bd6d4960c6427dc5cfef0f6ab73e167b1d45e1dbe6f4286c0a806
data/Appraisals CHANGED
@@ -43,5 +43,5 @@ appraise "rails-5-2" do
43
43
  group :mysql do
44
44
  gem "mysql2", "~> 0.4.10", platforms: [:ruby]
45
45
  end
46
- gem "activerecord", "~> 5.2.0.rc1"
46
+ gem "activerecord", "~> 5.2.1"
47
47
  end
@@ -1,5 +1,12 @@
1
1
  # Change Log
2
2
 
3
+ ## [v0.9.15](https://github.com/swanandp/acts_as_list/tree/v0.9.15) (2018-06-11)
4
+ [Full Changelog](https://github.com/swanandp/acts_as_list/compare/v0.9.14...v0.9.15)
5
+
6
+ **Merged pull requests:**
7
+
8
+ - Fix \#314: `no\_update` is not applied to subclasses [\#315](https://github.com/swanandp/acts_as_list/pull/315) ([YoranBrondsema](https://github.com/YoranBrondsema))
9
+
3
10
  ## [v0.9.14](https://github.com/swanandp/acts_as_list/tree/v0.9.14) (2018-06-05)
4
11
  [Full Changelog](https://github.com/swanandp/acts_as_list/compare/v0.9.13...v0.9.14)
5
12
 
data/Gemfile CHANGED
@@ -6,7 +6,10 @@ gemspec
6
6
 
7
7
  gem "rake"
8
8
  gem "appraisal"
9
- gem "github_changelog_generator", "1.9.0"
9
+
10
+ group :development do
11
+ gem "github_changelog_generator", "1.9.0"
12
+ end
10
13
 
11
14
  group :test do
12
15
  gem "minitest", "~> 5.0"
@@ -5,9 +5,12 @@ source "http://rubygems.org"
5
5
  gem "rack", "~> 1", platforms: [:ruby_19, :ruby_20, :ruby_21]
6
6
  gem "rake"
7
7
  gem "appraisal"
8
- gem "github_changelog_generator", "1.9.0"
9
8
  gem "activerecord", "~> 3.2.22.2"
10
9
 
10
+ group :development do
11
+ gem "github_changelog_generator", "1.9.0"
12
+ end
13
+
11
14
  group :test do
12
15
  gem "minitest", "~> 5.0"
13
16
  gem "test_after_commit", "~> 0.4.2"
@@ -5,9 +5,12 @@ source "http://rubygems.org"
5
5
  gem "rack", "~> 1", platforms: [:ruby_19, :ruby_20, :ruby_21]
6
6
  gem "rake"
7
7
  gem "appraisal"
8
- gem "github_changelog_generator", "1.9.0"
9
8
  gem "activerecord", "~> 4.1.16"
10
9
 
10
+ group :development do
11
+ gem "github_changelog_generator", "1.9.0"
12
+ end
13
+
11
14
  group :test do
12
15
  gem "minitest", "~> 5.0"
13
16
  gem "test_after_commit", "~> 0.4.2"
@@ -5,9 +5,12 @@ source "http://rubygems.org"
5
5
  gem "rack", "~> 1", platforms: [:ruby_19, :ruby_20, :ruby_21]
6
6
  gem "rake"
7
7
  gem "appraisal"
8
- gem "github_changelog_generator", "1.9.0"
9
8
  gem "activerecord", "~> 4.2.10"
10
9
 
10
+ group :development do
11
+ gem "github_changelog_generator", "1.9.0"
12
+ end
13
+
11
14
  group :test do
12
15
  gem "minitest", "~> 5.0"
13
16
  gem "test_after_commit", "~> 0.4.2"
@@ -5,9 +5,12 @@ source "http://rubygems.org"
5
5
  gem "rack", "~> 1", platforms: [:ruby_19, :ruby_20, :ruby_21]
6
6
  gem "rake"
7
7
  gem "appraisal"
8
- gem "github_changelog_generator", "1.9.0"
9
8
  gem "activerecord", "~> 5.0.6"
10
9
 
10
+ group :development do
11
+ gem "github_changelog_generator", "1.9.0"
12
+ end
13
+
11
14
  group :test do
12
15
  gem "minitest", "~> 5.0"
13
16
  gem "test_after_commit", "~> 0.4.2"
@@ -5,9 +5,12 @@ source "http://rubygems.org"
5
5
  gem "rack", "~> 1", platforms: [:ruby_19, :ruby_20, :ruby_21]
6
6
  gem "rake"
7
7
  gem "appraisal"
8
- gem "github_changelog_generator", "1.9.0"
9
8
  gem "activerecord", "~> 5.1.4"
10
9
 
10
+ group :development do
11
+ gem "github_changelog_generator", "1.9.0"
12
+ end
13
+
11
14
  group :test do
12
15
  gem "minitest", "~> 5.0"
13
16
  gem "test_after_commit", "~> 0.4.2"
@@ -5,9 +5,12 @@ source "http://rubygems.org"
5
5
  gem "rack", "~> 1", platforms: [:ruby_19, :ruby_20, :ruby_21]
6
6
  gem "rake"
7
7
  gem "appraisal"
8
- gem "github_changelog_generator", "1.9.0"
9
8
  gem "activerecord", "~> 5.2.0.rc1"
10
9
 
10
+ group :development do
11
+ gem "github_changelog_generator", "1.9.0"
12
+ end
13
+
11
14
  group :test do
12
15
  gem "minitest", "~> 5.0"
13
16
  gem "test_after_commit", "~> 0.4.2"
@@ -232,7 +232,7 @@ module ActiveRecord
232
232
  acts_as_list_class.where(scope_condition)
233
233
  end
234
234
  else
235
- acts_as_list_class.unscope(:where).where(scope_condition)
235
+ acts_as_list_class.unscope(:select, :where).where(scope_condition)
236
236
  end
237
237
  end
238
238
 
@@ -3,7 +3,7 @@
3
3
  module ActiveRecord
4
4
  module Acts
5
5
  module List
6
- VERSION = '0.9.15'
6
+ VERSION = '0.9.16'
7
7
  end
8
8
  end
9
9
  end
@@ -13,7 +13,7 @@ rescue Bundler::BundlerError => e
13
13
  end
14
14
  require "active_record"
15
15
  require "minitest/autorun"
16
- require "mocha/minitest"
16
+ require "mocha/mini_test"
17
17
  require "#{File.dirname(__FILE__)}/../init"
18
18
 
19
19
  if defined?(ActiveRecord::VERSION) &&
@@ -0,0 +1,33 @@
1
+ require 'helper'
2
+
3
+ class Animal < ActiveRecord::Base
4
+ acts_as_list
5
+ default_scope -> { select(:name) }
6
+ end
7
+
8
+ class DefaultScopeWithSelectTest < Minitest::Test
9
+ def setup
10
+ ActiveRecord::Base.connection.create_table :animals do |t|
11
+ t.column :position, :integer
12
+ t.column :name, :string
13
+ end
14
+
15
+ ActiveRecord::Base.connection.schema_cache.clear!
16
+ Animal.reset_column_information
17
+ super
18
+ end
19
+
20
+ def teardown
21
+ teardown_db
22
+ super
23
+ end
24
+
25
+ def test_default_scope_with_select
26
+ animal1 = Animal.create name: 'Fox'
27
+ animal2 = Animal.create name: 'Panda'
28
+ animal3 = Animal.create name: 'Wildebeast'
29
+ assert_equal 1, animal1.position
30
+ assert_equal 2, animal2.position
31
+ assert_equal 3, animal3.position
32
+ end
33
+ end
@@ -2,21 +2,21 @@
2
2
 
3
3
  require 'helper'
4
4
 
5
- class TodoItem < ActiveRecord::Base
5
+ class MasterItem < ActiveRecord::Base
6
6
  acts_as_list
7
7
  end
8
8
 
9
- class SubTodoItem < TodoItem; end
9
+ class SlaveItem < MasterItem; end
10
10
 
11
11
  class NoUpdateForSubclassesTestCase < Minitest::Test
12
12
  def setup
13
- ActiveRecord::Base.connection.create_table :todo_items do |t|
13
+ ActiveRecord::Base.connection.create_table :master_items do |t|
14
14
  t.column :position, :integer
15
15
  t.column :type, :string
16
16
  end
17
17
 
18
18
  ActiveRecord::Base.connection.schema_cache.clear!
19
- [TodoItem, SubTodoItem].each(&:reset_column_information)
19
+ [MasterItem, SlaveItem].each(&:reset_column_information)
20
20
  super
21
21
  end
22
22
 
@@ -30,7 +30,7 @@ class NoUpdateForSubclassesTest < NoUpdateForSubclassesTestCase
30
30
  def setup
31
31
  super
32
32
  @item_1, @item_2 = (1..2).map do |counter|
33
- SubTodoItem.create!(position: counter)
33
+ SlaveItem.create!(position: counter)
34
34
  end
35
35
  end
36
36
 
@@ -41,14 +41,14 @@ class NoUpdateForSubclassesTest < NoUpdateForSubclassesTestCase
41
41
  end
42
42
 
43
43
  def test_no_update_for_subclass_instances_with_no_update_on_superclass
44
- TodoItem.acts_as_list_no_update { @item_1.update_attributes(position: 2) }
44
+ MasterItem.acts_as_list_no_update { @item_1.update_attributes(position: 2) }
45
45
 
46
46
  assert_equal 2, @item_1.reload.position
47
47
  assert_equal 2, @item_2.reload.position
48
48
  end
49
49
 
50
50
  def test_no_update_for_subclass_instances_with_no_update_on_subclass
51
- SubTodoItem.acts_as_list_no_update { @item_1.update_attributes(position: 2) }
51
+ SlaveItem.acts_as_list_no_update { @item_1.update_attributes(position: 2) }
52
52
 
53
53
  assert_equal 2, @item_1.reload.position
54
54
  assert_equal 2, @item_2.reload.position
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.15
4
+ version: 0.9.16
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: 2018-06-11 00:00:00.000000000 Z
13
+ date: 2018-08-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord
@@ -88,6 +88,7 @@ files:
88
88
  - test/shared_quoting.rb
89
89
  - test/shared_top_addition.rb
90
90
  - test/shared_zero_based.rb
91
+ - test/test_default_scope_with_select.rb
91
92
  - test/test_joined_list.rb
92
93
  - test/test_list.rb
93
94
  - test/test_no_update_for_extra_classes.rb
@@ -129,6 +130,7 @@ test_files:
129
130
  - test/shared_quoting.rb
130
131
  - test/shared_top_addition.rb
131
132
  - test/shared_zero_based.rb
133
+ - test/test_default_scope_with_select.rb
132
134
  - test/test_joined_list.rb
133
135
  - test/test_list.rb
134
136
  - test/test_no_update_for_extra_classes.rb