effective_resources 2.1.1 → 2.1.3

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
  SHA256:
3
- metadata.gz: 1fdc93f33038497592b4ddb1c493191567d6c85e995fbf81eee114ed24c0c690
4
- data.tar.gz: a93e21e2cdb21e570bd60ba383bfcb5eb3ce561c7ec87a5420141912c8e24c06
3
+ metadata.gz: 91015a3de5ffe3fd8727b1076558a95eedd3601ce768cf7c24befa42635c6a1b
4
+ data.tar.gz: 655794c38fa9b32c7fd40692469fe255152820e497d727a69336429d8f7e3acc
5
5
  SHA512:
6
- metadata.gz: d8d8b01b110fc396d02a8a813e2bfe5aa3d072f23141c3cf4c91033c5a4fe12ee46ba745b7175bee21cd811b1d90bf25c5631e2fe2f33c5aafe0cb94e251eedb
7
- data.tar.gz: f857d31677d5519415cbe90804e4a707f21eb8b89b5ef9d36ae207686f9c4236c27b251d0fdd76a4721b7e49b42f3082edd53c2199997566e8faface7986480d
6
+ metadata.gz: 427908e33318358ca2a00ea9d578585cd18ae62dd952016e129878ebc778303084c8af06ba5dbb2d919440f9d5a0733788895cd8d77a38224915e84381d6755b
7
+ data.tar.gz: 53fa67e820609b4349e1623975aee917954d865cf85dba56e27b70000a953b1394d17ab098f684a900cf60274ea25ec71e56c952f5f146822fe04c9bc39299ad
@@ -293,4 +293,12 @@ module EffectiveResourcesHelper
293
293
  end
294
294
  end
295
295
 
296
+ def return_to_dashboard_path
297
+ path = (Tenant.routes.dashboard_path rescue nil) if defined?(Tenant) && Tenant.routes.respond_to?(:dashboard_path)
298
+ path ||= (main_app.dashboard_path rescue nil) if main_app.respond_to?(:dashboard_path)
299
+ path ||= (main_app.root_path rescue nil) if main_app.respond_to?(:root_path)
300
+
301
+ path || '/'
302
+ end
303
+
296
304
  end
@@ -40,7 +40,7 @@ module ActsAsSlugged
40
40
  return super unless args.length == 1
41
41
  return super if block_given?
42
42
 
43
- where(slug: args.first).or(where(id: args.first)).first || raise(::ActiveRecord::RecordNotFound.new("Couldn't find #{name} with 'slug'=#{args.first}"))
43
+ where(slug: args.first).first || raise(::ActiveRecord::RecordNotFound.new("Couldn't find #{name} with 'slug'=#{args.first}"))
44
44
  end
45
45
 
46
46
  def find_by_slug_or_id(*args)
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '2.1.1'.freeze
2
+ VERSION = '2.1.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-31 00:00:00.000000000 Z
11
+ date: 2022-11-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails