inline_forms_installer 8.1.4 → 8.1.5
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7ebb695af4c902a20604e51deb4fc8a2eefaf32e625cf86805633ffd65e048d4
|
|
4
|
+
data.tar.gz: 1b630b3fc3f578fbde245ec2957c9cedc60c0dc27cf28d506b56a41361fb9d5c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 50c22db56f53d41b37f9aaffb44298478a707fbd8f36d962a280e8d952f1c77a25306f6c9e2ecd10f59b825807ced7f172c6dfa547d613efa3569cee6c3e88ec
|
|
7
|
+
data.tar.gz: 1c4b64a00674ca2096c1b40c2f48f7bed3c2bd696f0fdf0cd295c6f7df093b244047040e2b07059c42364dd26e842040218973ea002324aafc6780a388ed7d62
|
|
@@ -384,25 +384,25 @@ create_file user_cfg.model_path, <<-USER_MODEL.strip_heredoc
|
|
|
384
384
|
|
|
385
385
|
def inline_forms_attribute_list
|
|
386
386
|
@inline_forms_attribute_list ||= [
|
|
387
|
-
[ :header_user_login,
|
|
388
|
-
[ :name,
|
|
389
|
-
[ :email,
|
|
390
|
-
[ :locale
|
|
391
|
-
[ :password,
|
|
392
|
-
[ :header_user_roles,
|
|
393
|
-
[ :roles,
|
|
394
|
-
[ :header_user_other_stuff,
|
|
395
|
-
[ :encrypted_password,
|
|
396
|
-
[ :reset_password_token,
|
|
397
|
-
[ :reset_password_sent_at,
|
|
398
|
-
[ :remember_created_at,
|
|
399
|
-
[ :sign_in_count,
|
|
400
|
-
[ :current_sign_in_at,
|
|
401
|
-
[ :last_sign_in_at,
|
|
402
|
-
[ :current_sign_in_ip,
|
|
403
|
-
[ :last_sign_in_ip,
|
|
404
|
-
[ :created_at,
|
|
405
|
-
[ :updated_at,
|
|
387
|
+
[ :header_user_login, :header ],
|
|
388
|
+
[ :name, :text_field ],
|
|
389
|
+
[ :email, :text_field ],
|
|
390
|
+
[ :locale, :dropdown ],
|
|
391
|
+
[ :password, :devise_password_field ],
|
|
392
|
+
[ :header_user_roles, :header ],
|
|
393
|
+
[ :roles, :check_list ],
|
|
394
|
+
[ :header_user_other_stuff, :header ],
|
|
395
|
+
[ :encrypted_password, :info ],
|
|
396
|
+
[ :reset_password_token, :info ],
|
|
397
|
+
[ :reset_password_sent_at, :info ],
|
|
398
|
+
[ :remember_created_at, :info ],
|
|
399
|
+
[ :sign_in_count, :info ],
|
|
400
|
+
[ :current_sign_in_at, :info ],
|
|
401
|
+
[ :last_sign_in_at, :info ],
|
|
402
|
+
[ :current_sign_in_ip, :info ],
|
|
403
|
+
[ :last_sign_in_ip, :info ],
|
|
404
|
+
[ :created_at, :info ],
|
|
405
|
+
[ :updated_at, :info ],
|
|
406
406
|
]
|
|
407
407
|
end
|
|
408
408
|
|
|
@@ -865,7 +865,7 @@ if ENV['install_example'] == 'true'
|
|
|
865
865
|
# so it appears above :name in the inline panel.
|
|
866
866
|
gsub_file "app/models/apartment.rb",
|
|
867
867
|
/@inline_forms_attribute_list \|\|= \[\n/,
|
|
868
|
-
"@inline_forms_attribute_list ||= [\n [ :owner
|
|
868
|
+
"@inline_forms_attribute_list ||= [\n [ :owner, :dropdown ], \n"
|
|
869
869
|
|
|
870
870
|
# Owner -> apartments: render as a check_list of EXISTING apartments
|
|
871
871
|
# (not the default :associated panel that only lets you create new
|
|
@@ -873,8 +873,8 @@ if ENV['install_example'] == 'true'
|
|
|
873
873
|
# `apartment_ids=` setter that CheckListHelper uses, so we just swap
|
|
874
874
|
# the form element kind in the generated attribute list.
|
|
875
875
|
gsub_file "app/models/owner.rb",
|
|
876
|
-
/\[ :apartments
|
|
877
|
-
'[ :apartments
|
|
876
|
+
/\[ :apartments, :associated \]/,
|
|
877
|
+
'[ :apartments, :check_list ]'
|
|
878
878
|
|
|
879
879
|
say "- Replacing OwnersController with tabbed-show variant (/owners/:id)..."
|
|
880
880
|
remove_file "app/controllers/owners_controller.rb"
|
|
@@ -914,7 +914,7 @@ if ENV['install_example'] == 'true'
|
|
|
914
914
|
def owner_attributes_for(tab)
|
|
915
915
|
full = @object.inline_forms_attribute_list
|
|
916
916
|
OWNER_TAB_FIELDS.fetch(tab).map do |attr|
|
|
917
|
-
full.find { |a, _
|
|
917
|
+
full.find { |a, _| a == attr } ||
|
|
918
918
|
raise("OwnersController: attribute \#{attr.inspect} missing from Owner#inline_forms_attribute_list")
|
|
919
919
|
end
|
|
920
920
|
end
|
|
@@ -14,7 +14,7 @@ class ExampleAppPlainTextRichTextEdgeCasesTest < ActiveSupport::TestCase
|
|
|
14
14
|
test "plain_text mapped to actiontext-backed attribute raises configuration error" do
|
|
15
15
|
with_temporary_inline_forms_attribute_list(
|
|
16
16
|
Apartment,
|
|
17
|
-
[[:description,
|
|
17
|
+
[[:description, :plain_text]]
|
|
18
18
|
) do
|
|
19
19
|
error = assert_raises(InlineForms::PlainTextColumnMissingError) do
|
|
20
20
|
InlineForms.validate_plain_text_configuration_for!(Apartment)
|
|
@@ -38,7 +38,7 @@ class ExampleAppPlainTextRichTextEdgeCasesTest < ActiveSupport::TestCase
|
|
|
38
38
|
test "switching text column field from plain_text to rich_text does not raise" do
|
|
39
39
|
with_temporary_inline_forms_attribute_list(
|
|
40
40
|
Role,
|
|
41
|
-
[[:description,
|
|
41
|
+
[[:description, :rich_text]]
|
|
42
42
|
) do
|
|
43
43
|
InlineForms.validate_plain_text_configuration_for!(Role)
|
|
44
44
|
end
|