hashid-rails 1.1.0 → 1.1.1
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 +3 -0
- data/lib/hashid/rails.rb +10 -0
- data/lib/hashid/rails/version.rb +1 -1
- 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: 66d9ab4bf57ba4701a2c7b6b3623918acf8d6d5b
|
4
|
+
data.tar.gz: 9c3d4ddb80707ba6d37527fb42866a5d207476a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 890565c0d8146c4cd14767b6532c00173e94f2d0d88945575a763ad657c68c01cca430740849914321024f46978006f49e1f4c3818b270dfdfabe6477cf0de63
|
7
|
+
data.tar.gz: 462f649bb6208099c1aa5901d6868fb2ee94841121864f1c4d5a29059b8dc3abdf230804d9deb052469071345c29e7fc9959a7975afc2cbcda2a516c1856d227
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 1.1.1 (2017-11-03)
|
4
|
+
- Fix eager loading and finding records through a parent. ([#39](https://github.com/jcypret/hashid-rails/pull/39))
|
5
|
+
|
3
6
|
## 1.1.0 (2017-10-04)
|
4
7
|
- Add option to disable hashid signing. This adds backwards compatibility with
|
5
8
|
pre-1.0 releases. Thanks [@olliebennett](https://github.com/olliebennett)! ([#37](https://github.com/jcypret/hashid-rails/pull/37))
|
data/lib/hashid/rails.rb
CHANGED
@@ -34,6 +34,16 @@ module Hashid
|
|
34
34
|
alias to_param hashid
|
35
35
|
|
36
36
|
module ClassMethods
|
37
|
+
def relation
|
38
|
+
super.tap { |r| r.extend ClassMethods }
|
39
|
+
end
|
40
|
+
|
41
|
+
def has_many(*args, &block) # rubocop:disable Style/PredicateName
|
42
|
+
options = args.extract_options!
|
43
|
+
options[:extend] = Array(options[:extend]).push(ClassMethods)
|
44
|
+
super(*args, options, &block)
|
45
|
+
end
|
46
|
+
|
37
47
|
def encode_id(ids)
|
38
48
|
if ids.is_a?(Array)
|
39
49
|
ids.map { |id| hashid_encode(id) }
|
data/lib/hashid/rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hashid-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Cypret
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|