rails_bootstrap_form 0.9.6 → 0.9.7
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/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/demo/app/models/admin_user.rb +11 -0
- data/demo/app/models/super_user.rb +13 -0
- data/lib/rails_bootstrap_form/helpers/errors.rb +2 -2
- data/lib/rails_bootstrap_form/helpers/required_field.rb +1 -1
- data/lib/rails_bootstrap_form/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ffc0cdcd818f57b7e0b683ec59b2ac3a59b80edab6e40f9eebe1da8d32cd376
|
4
|
+
data.tar.gz: 676be2383b1d1421b70a50ad5dc044eed15dfe4707b26ca345077644de9abebc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdf31544bc3fd0032dff7b12bb95b1af33466d8e5a199ea0ecd263e1a8cdfdc2d00b02cc95425a1e712c6f2edd8ca626cf5e9ca6523fdf7eecf66a5a4776b17e
|
7
|
+
data.tar.gz: 60e72524a66706827e25fd018ffbe4dc75e823d346a86627c525e0e9f095af6a490846dc04526127708f4c30811f59c30c94b32936543055dcc6bf2fd6a3af4f
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,12 @@ You can find recent releases with docs in GitHub:
|
|
4
4
|
|
5
5
|
https://github.com/shivam091/rails_bootstrap_form/releases
|
6
6
|
|
7
|
+
## [0.9.7](https://github.com/shivam091/rails_bootstrap_form/compare/v0.9.6...v0.9.7) - 2023-06-26
|
8
|
+
|
9
|
+
### What's new
|
10
|
+
|
11
|
+
- Added specs for field helpers to ensure validation errors are rendered correctly in each layout.
|
12
|
+
|
7
13
|
## [0.9.6](https://github.com/shivam091/rails_bootstrap_form/compare/v0.9.5...v0.9.6) - 2023-06-25
|
8
14
|
|
9
15
|
### What's new
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
# -*- frozen_string_literal: true -*-
|
3
|
+
# -*- warn_indent: true -*-
|
4
|
+
|
5
|
+
class SuperUser
|
6
|
+
attr_accessor :email, :password
|
7
|
+
|
8
|
+
def initialize(attributes = {})
|
9
|
+
attributes.each do |name, value|
|
10
|
+
send("#{name}=", value)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -29,7 +29,7 @@ module RailsBootstrapForm
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def has_association_error?(attribute)
|
32
|
-
object.class.reflections
|
32
|
+
object.class.try(:reflections)&.any? do |association_name, association|
|
33
33
|
next unless is_belongs_to_association?(association)
|
34
34
|
next unless is_association_same?(attribute, association)
|
35
35
|
|
@@ -40,7 +40,7 @@ module RailsBootstrapForm
|
|
40
40
|
def error_messages(attribute)
|
41
41
|
messages = object.errors[attribute]
|
42
42
|
|
43
|
-
object.class.reflections
|
43
|
+
object.class.try(:reflections)&.each do |association_name, association|
|
44
44
|
next unless is_belongs_to_association?(association)
|
45
45
|
next unless is_association_same?(attribute, association)
|
46
46
|
|
@@ -48,7 +48,7 @@ module RailsBootstrapForm
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def is_required_association?(target, attribute)
|
51
|
-
target.reflections
|
51
|
+
target.try(:reflections)&.find do |name, a|
|
52
52
|
next unless a.is_a?(ActiveRecord::Reflection::BelongsToReflection)
|
53
53
|
next unless a.foreign_key == attribute.to_s
|
54
54
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_bootstrap_form
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Harshal LADHE (shivam091)
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: generator_spec
|
@@ -86,11 +86,13 @@ files:
|
|
86
86
|
- demo/app/jobs/application_job.rb
|
87
87
|
- demo/app/mailers/application_mailer.rb
|
88
88
|
- demo/app/models/address.rb
|
89
|
+
- demo/app/models/admin_user.rb
|
89
90
|
- demo/app/models/application_record.rb
|
90
91
|
- demo/app/models/city.rb
|
91
92
|
- demo/app/models/country.rb
|
92
93
|
- demo/app/models/fruit.rb
|
93
94
|
- demo/app/models/skill.rb
|
95
|
+
- demo/app/models/super_user.rb
|
94
96
|
- demo/app/models/user.rb
|
95
97
|
- demo/app/models/user_skill.rb
|
96
98
|
- demo/app/views/active_storage/blobs/_blob.html.erb
|