tramway-admin 1.28 → 1.28.0.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/app/controllers/tramway/admin/application_controller.rb +1 -1
- data/app/controllers/tramway/admin/has_and_belongs_to_many_records_controller.rb +2 -0
- data/app/helpers/tramway/admin/actions_helper.rb +4 -2
- data/app/helpers/tramway/admin/inputs_helper.rb +1 -1
- data/config/routes.rb +1 -1
- data/lib/tramway/admin/forms.rb +2 -0
- data/lib/tramway/admin/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 374edd0b18c286dc1420409c506829049c419ead74336b62b907a95e4b7667fb
|
|
4
|
+
data.tar.gz: 4991e8bd1cf2d706a75bb0861e9ea34f88ac4fb7eb7f7c32bae3aec057f163b8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 91afe926391ff2bfc6253fb3b80d7ee7f57e7fe0d4c9cf6b2a3be1aeb1620e1fd82da4883a144eff61a417a7a20593328bb8f7cb866d5059782e0e8be5837d53
|
|
7
|
+
data.tar.gz: 856d74e90b384d4e31f3ae751cf0196d0d40ac881904e1afdf001cbf91f571526c4a53891bf6766f700afb348f6cca75f6290f1423db17ffc6c6c6f748c861d5
|
|
@@ -84,7 +84,7 @@ module Tramway
|
|
|
84
84
|
end
|
|
85
85
|
|
|
86
86
|
def form_given?
|
|
87
|
-
Tramway::Admin.forms.include? params[:form].underscore.sub(
|
|
87
|
+
Tramway::Admin.forms.include? params[:form].underscore.sub(%r{^admin/}, '').sub(/_form$/, '')
|
|
88
88
|
end
|
|
89
89
|
|
|
90
90
|
def available_scope_given?
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Tramway::Admin::ActionsHelper
|
|
2
|
-
def destroy_is_available?(association_object,
|
|
4
|
+
def destroy_is_available?(association_object, _main_object)
|
|
3
5
|
::Tramway::Admin.action_is_available?(
|
|
4
6
|
association_object,
|
|
5
7
|
project: (@application_engine || @application.name),
|
|
6
8
|
model_name: association_object.model.class.name,
|
|
7
9
|
role: current_user.role,
|
|
8
10
|
action: :destroy
|
|
9
|
-
)
|
|
11
|
+
)
|
|
10
12
|
end
|
|
11
13
|
|
|
12
14
|
def habtm_destroy_is_available?(association_object, main_object)
|
|
@@ -6,7 +6,7 @@ module Tramway
|
|
|
6
6
|
def association_params(form_object:, property:, value:, object:, options: {})
|
|
7
7
|
full_class_name_association = form_object.class.full_class_name_association(property)
|
|
8
8
|
unless full_class_name_association
|
|
9
|
-
raise "It seems you
|
|
9
|
+
raise "It seems you've defined association attributes with `property` method. Please, use `association` method. `association :#{property}`"
|
|
10
10
|
end
|
|
11
11
|
if full_class_name_association.is_a? Array
|
|
12
12
|
raise "It seems you've used `association` input type in the Form. Please, use `polymorphic_association` type. `#{property}: :polymorphic_association`"
|
data/config/routes.rb
CHANGED
|
@@ -8,5 +8,5 @@ Tramway::Admin::Engine.routes.draw do
|
|
|
8
8
|
|
|
9
9
|
resources :records
|
|
10
10
|
resource :singleton, only: %i[new create show edit update]
|
|
11
|
-
resources :has_and_belongs_to_many_records, only: [
|
|
11
|
+
resources :has_and_belongs_to_many_records, only: %i[create destroy]
|
|
12
12
|
end
|
data/lib/tramway/admin/forms.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tramway-admin
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 1.28.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Pavel Kalashnikov
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-03-
|
|
11
|
+
date: 2020-03-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bootstrap-kaminari-views
|