ntq_tools 0.5.1 → 0.6.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
  SHA256:
3
- metadata.gz: e852b85c98ac5a88f421e947d452f27c454dd0c6642b90513d312ac0f79bc7b9
4
- data.tar.gz: eb9e04c44a0ed9b046b119eb1a4e6dde0ef57887c7d077687dfb458b5d2300f3
3
+ metadata.gz: '019d7dc36a586c41c90f0344dc403b659636885801160c02ce727bce64a67c02'
4
+ data.tar.gz: c428933a52c6da37c406d6b7d67506c653144c8db7b0256c7a0ac5979f784a5f
5
5
  SHA512:
6
- metadata.gz: 159a98d24dcf9298112f3db9c8e2d399a0a7ebc68e66a1957f6288775825533a40c2559576e502ec6688a9dec20d6d97beb383f8155897d8d1f6e90d7c6b97ae
7
- data.tar.gz: 359ab06d15629daa95a49775838a2e8a5b0a68a5fcc76a260322840e28896c3dfd9f267ebaacbeece3a35d40e613dfcdec4e76a1ce85273c9d2e89e34fdd2db2
6
+ metadata.gz: 16a33bdd9c21bb5c83f4f3b82bc983f8072ce75bf31a144c1056fc364e6a10e03392055e1d4c44c85e6690c5993c6f00e7bd52e7fb028577c1d99fefe22388ef
7
+ data.tar.gz: d52ae223a99923e7c85c47d240d81b65f222c2be988aa044b7c0336c12345206382b1ae961a22fa3b9dd4a8010105fe66cf632232816150bdf2a63bf36716c31
@@ -1,6 +1,9 @@
1
1
  module NtqTools
2
2
  class ImpersonationController < ::ApplicationController
3
-
3
+ skip_before_action :authenticate_user!, raise: false, if: -> { Rails.env.development? }
4
+ skip_before_action :authenticate_back_user!, raise: false, if: -> { Rails.env.development? }
5
+ skip_before_action :authenticate_customer!, raise: false, if: -> { Rails.env.development? }
6
+
4
7
  before_action :check_impersonation_enabled, except: [:config]
5
8
  before_action :model_name_is_valid?, only: [:sign_in]
6
9
 
@@ -5,8 +5,8 @@ module NtqTools
5
5
  before_action :check_presence_of_key, except: [:refresh]
6
6
 
7
7
  def show
8
- return render json: { data: nil }, status: 404 unless I18n.exists?(params[:key].to_s)
9
-
8
+ return render json: { data: nil }, status: 404 unless I18n.exists?(params[:key].to_s)
9
+
10
10
  render json: {
11
11
  data: I18n.t(params[:key])
12
12
  }, status: 200
data/config/routes.rb CHANGED
@@ -2,7 +2,7 @@ NtqTools::Engine.routes.draw do
2
2
  resource :translation, only: [:update, :show]
3
3
  get '/translation/refresh' => "translations#refresh"
4
4
 
5
- if NtqTools.impersonation_enabled && NtqTools.impersonation_user_models.any? && defined?(Devise)
5
+ if NtqTools.impersonation_enabled && NtqTools.impersonation_user_models.any? && defined?(Devise) && Rails.env.development?
6
6
  get '/impersonation/users' => "impersonation#index"
7
7
  get "/impersonation/:model_name/:id/sign_in" => "impersonation#signin"
8
8
  end
@@ -242,7 +242,7 @@ module #{context_name}
242
242
  class Search#{class_name}
243
243
  include Interactor::Organizer
244
244
 
245
- organize Get#{class_name}, PaginateRecords
245
+ organize Get#{plural_name.camelcase}, PaginateRecords
246
246
  end
247
247
  end
248
248
  FILE
@@ -269,7 +269,7 @@ end
269
269
  argument :per_page, Integer, required: false
270
270
  end
271
271
  def #{plural_name}(search: {}, page: 1, per_page: 25)
272
- ctx = ::#{plural_name.camelcase}::Search#{singular_name.camelcase}.call(search: search, pagination_params: { page: page, per_page: per_page })
272
+ ctx = ::#{plural_name.camelcase}::Search#{plural_name.camelcase}.call(search: search, pagination_params: { page: page, per_page: per_page })
273
273
  {
274
274
  #{plural_name}: ctx.records,
275
275
  pagination: ctx.pagination
@@ -1,3 +1,3 @@
1
1
  module NtqTools
2
- VERSION = "0.5.1"
2
+ VERSION = "0.6.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ntq_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-25 00:00:00.000000000 Z
11
+ date: 2023-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails