sequel_polymorphic 0.3.1 → 0.4.0

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: 868e62f45832d89c8ddf9082692464f80a6e387d
4
- data.tar.gz: '0995011550be7e6b523901eb143721da6b21f68c'
3
+ metadata.gz: 24f401afafb33d285fb0b2008fe2d4620f0147a7
4
+ data.tar.gz: 8f342a1e1506642da11015bcaa81eeb043649900
5
5
  SHA512:
6
- metadata.gz: 7415a5e08d53faa1375c24a7ee4b574bea1c94ba6b01927d798177f331725e6311554c0b9e1784f6bd69fe8963f0bf9a84a4b09b42c7cfe09bacb4ef55028b8b
7
- data.tar.gz: 2122bc2e699b66f7b619238ab771a9e41997e1099a2d9d4ebb3311b592a84a1765c62ce43ada77f9781e5eed151c6e6936a62caf844ef359204b99320b983b48
6
+ metadata.gz: 52f09f38901b1fc534b3b849fdcc92c057f31583de6a7b89d76445a84f18ad4aa9585e49fdecf5607ba8ca15bf1f54063fd251b5a8c62153bb2fac8e36b75ec9
7
+ data.tar.gz: 26d5d0f09533e8c5c539119f8b6115248293fdd36e15715257f403805541191d76f44e68ce7371464a2faecad891d5ebf80f0d57737d0915910241a181a5e260
data/CHANGELOG.md CHANGED
@@ -1,11 +1,38 @@
1
- # 0.3.1 (2017-01-05) 0.3.1
1
+ # 0.4.0 (2017-10-25)
2
+
3
+ * **Enhancements**: *migrate to new Sequel's plugins tree schema.*
4
+
5
+ This step is required for Sequel 5 compatibility.
6
+
7
+ See [#27](https://github.com/jackdempsey/sequel_polymorphic/pull/27).
8
+ Thanks to [@jnylen](https://github.com/jnylen).
9
+
10
+ * **Enhancements**: *get rid of `schema` Sequel's plugin*.
11
+
12
+ This step is required for Sequel 5 compatibility.
13
+
14
+ See [#23](https://github.com/jackdempsey/sequel_polymorphic/pull/23).
15
+ Thanks to [@jnylen](https://github.com/jnylen).
16
+
17
+ * **Fix**: *`one_to_one` association tries to add an adder, remover and clearer methods*.
18
+
19
+ It's not correct and dues to an error in Sequel 5.
20
+
21
+ See [#26](https://github.com/jackdempsey/sequel_polymorphic/pull/26).
22
+ Thanks to [@jnylen](https://github.com/jnylen).
23
+
24
+ * **Feature**: *make this gem compatible with Sequel 5.x.x versions*.
25
+
26
+ See previous changes in this version.
27
+
28
+ # 0.3.1 (2017-01-05)
2
29
 
3
30
  * **Fix**: *blocks are not passed to `associate`*.
4
31
 
5
- See [#21](https://github.com/jackdempsey/sequel_polymorphic/pull/21).
6
- Thanks to [@shioyama](https://github.com/shioyama).
32
+ See [#21](https://github.com/jackdempsey/sequel_polymorphic/pull/21).
33
+ Thanks to [@shioyama](https://github.com/shioyama).
7
34
 
8
- # 0.3.0 (2016-12-12) 0.3.0
35
+ # 0.3.0 (2016-12-12)
9
36
 
10
37
  * **Feature**: *add one-to-one polymorphic associations support*.
11
38
 
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  A simple plugin for [Sequel](http://sequel.jeremyevans.net) that lets you easily create polymorphic associations.
4
4
 
5
- Version 4.x is required.
5
+ Version 4.x.x or 5.x.x of Sequel is required.
6
6
 
7
7
  ## Usage examples
8
8
 
@@ -140,9 +140,10 @@ module Sequel
140
140
  :reciprocal => able,
141
141
  :reciprocal_type => :one_to_one,
142
142
  :conditions => {able_type => self.to_s},
143
- :adder => proc { |many_of_instance| many_of_instance.update(able_id => pk, able_type => self.class.to_s) },
144
- :remover => proc { |many_of_instance| many_of_instance.update(able_id => nil, able_type => nil) },
145
- :clearer => proc { send(many_dataset_name).update(able_id => nil, able_type => nil) }
143
+ :setter => (proc do |able_instance|
144
+ self[:"#{able}_id"] = (able_instance.pk if able_instance)
145
+ self[:"#{able}_type"] = (able_instance.class.name if able_instance)
146
+ end)
146
147
  }.merge(options)
147
148
  associate(:one_to_one, collection_name, association_options, &block)
148
149
  else
@@ -2,7 +2,7 @@ module Sequel
2
2
  module Plugins
3
3
  module Polymorphic
4
4
 
5
- VERSION = '0.3.1'
5
+ VERSION = '0.4.0'
6
6
 
7
7
  end # Polymorphic
8
8
  end # Plugins
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel_polymorphic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Dempsey
@@ -10,22 +10,28 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-01-05 00:00:00.000000000 Z
13
+ date: 2017-10-25 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: sequel
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - "~>"
19
+ - - ">="
20
+ - !ruby/object:Gem::Version
21
+ version: 4.0.0
22
+ - - "<"
20
23
  - !ruby/object:Gem::Version
21
- version: '4'
24
+ version: '6'
22
25
  type: :runtime
23
26
  prerelease: false
24
27
  version_requirements: !ruby/object:Gem::Requirement
25
28
  requirements:
26
- - - "~>"
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ version: 4.0.0
32
+ - - "<"
27
33
  - !ruby/object:Gem::Version
28
- version: '4'
34
+ version: '6'
29
35
  - !ruby/object:Gem::Dependency
30
36
  name: minitest
31
37
  requirement: !ruby/object:Gem::Requirement
@@ -111,9 +117,8 @@ files:
111
117
  - CHANGELOG.md
112
118
  - LICENSE
113
119
  - README.md
114
- - lib/sequel_polymorphic.rb
115
- - lib/sequel_polymorphic/sequel_polymorphic.rb
116
- - lib/sequel_polymorphic/version.rb
120
+ - lib/sequel/plugins/polymorphic.rb
121
+ - lib/sequel/plugins/polymorphic/version.rb
117
122
  homepage: https://github.com/jackdempsey/sequel_polymorphic
118
123
  licenses:
119
124
  - MIT
@@ -134,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
139
  version: '0'
135
140
  requirements: []
136
141
  rubyforge_project:
137
- rubygems_version: 2.5.2
142
+ rubygems_version: 2.5.2.1
138
143
  signing_key:
139
144
  specification_version: 4
140
145
  summary: A gem that provides Sequel::Models with polymorphic association capabilities
@@ -1,4 +0,0 @@
1
- $:.unshift(File.dirname(__FILE__)) unless
2
- $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
-
4
- require 'sequel_polymorphic/sequel_polymorphic'