friendly_routes 0.5.0 → 0.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fe66cea5553050a8e5fd7aa79ea09a8b03ab2226
4
- data.tar.gz: 795e61395c576e55426d68b8343ea231ac15b5c4
3
+ metadata.gz: dd836abf288ae5f9072f7da35f300a37cfbf31bf
4
+ data.tar.gz: ab34480af694a86b1c98934741f921af7b094ee0
5
5
  SHA512:
6
- metadata.gz: 11cd1edc4b0c4f38a00b04fc9e2a29fb403aad180e5e7a6ebe38a31d1df692ca656d7c9dab2e32c09492d4446d92bb5511d0056123b70b3b3abcd4686cbe2140
7
- data.tar.gz: 928ba6f615b00d1fb5e8dada10c868bc95611492e6945366c0b33b48847dc3220fd7307f37b1796d10a6f33bb74d8071ec334085aceb5147349a37cc646da575
6
+ metadata.gz: b9954ca6a4d9bd2623aee50cdf78ffce6f9cff96b970aa461aab966c4e69c16471bfbbfdc72ae09fef826a85ffd2764e2b6609ef444e7e7d670fb73f4be9b0af
7
+ data.tar.gz: 9d7764c924995f7f620ea489a1095afd0301baace01c43f3bcbd6bf2818570222525ce4cf23fc61716be211d36163273864eb6c2b23bfa71740f618bce09a57d
@@ -41,8 +41,8 @@ module FriendlyRoutes
41
41
  # @param [Integer|Object] id_or_instance collection instance or it id
42
42
  # @return [Boolean]
43
43
  def allowed?(id_or_instance)
44
- if id_or_instance.is_a?(@collection.class)
45
- @collection_ids.includes?(id_or_instance.id)
44
+ if id_or_instance.is_a?(ActiveRecord::Base)
45
+ @collection_ids.include?(id_or_instance.id)
46
46
  else
47
47
  @collection.find_by(id: id_or_instance).present?
48
48
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FriendlyRoutes
4
- VERSION = '0.5.0'
4
+ VERSION = '0.5.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: friendly_routes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Gritsay