avo 3.14.1 → 3.14.2

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: '082bc71609a798a5f6f6afd5d3a9ecedc5d20c292c51661947add5a9db6d0b90'
4
- data.tar.gz: 3b2330fd614901596747fd708360da3719acca547522170058985f8ab0134544
3
+ metadata.gz: 4afa827148ace09b3603b6cb458ad21bc4c80836049d113873e1fac697e2aafb
4
+ data.tar.gz: 273c05e9e9e996b2c8032f80d653b2bdc9a7395d84303040daf9099257d164d5
5
5
  SHA512:
6
- metadata.gz: e2764badea08bd8f1275641be392eee14246082cc49ca5e68ad8768acbe7dade7734c5543f34b25b4782f88fdccecb02fa04345f5bd736ac2f63919e181987ef
7
- data.tar.gz: 9bad7034ff00bf4e028d2dcf125411f97e3bab73c3e1d56a6c65ea95969c6d2505a4eaa789491262d84fadeed1817bcf73f83983c0e4fb3961389f92dc628af4
6
+ metadata.gz: 91ddea0958d710e3c15e55366de8d557731bacdeaa4d024ee26fddb7520aa85151cad47807d0f8a2e5f8ce6937a91847bf167babacaa58ba681f14c4c617eb5b
7
+ data.tar.gz: 35b5bf5e62b17a771e712f7f05f7ad9396bb745f31e1b631c0e079db3a65ed318b9b84be5a97474c78b9499150510103dd09850784c83e2516d616d4d3d28e5e
data/Gemfile.lock CHANGED
@@ -107,7 +107,7 @@ GIT
107
107
  PATH
108
108
  remote: .
109
109
  specs:
110
- avo (3.14.1)
110
+ avo (3.14.2)
111
111
  actionview (>= 6.1)
112
112
  active_link_to
113
113
  activerecord (>= 6.1)
@@ -179,7 +179,7 @@ module Avo
179
179
  end
180
180
 
181
181
  def name
182
- @name ||= name_from_translation_key(count: 1, default: class_name.underscore.humanize)
182
+ name_from_translation_key(count: 1, default: class_name.underscore.humanize)
183
183
  end
184
184
  alias_method :singular_name, :name
185
185
 
@@ -203,8 +203,6 @@ module Avo
203
203
  end
204
204
 
205
205
  def underscore_name
206
- return @name if @name.present?
207
-
208
206
  name.demodulize.underscore
209
207
  end
210
208
 
data/lib/avo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Avo
2
- VERSION = "3.14.1" unless const_defined?(:VERSION)
2
+ VERSION = "3.14.2" unless const_defined?(:VERSION)
3
3
  end
@@ -118,7 +118,14 @@ module Generators
118
118
  component = component_to_eject.underscore
119
119
 
120
120
  # Get the component path for both, the rb and erb files
121
- rb, erb = ["app/components/#{component}.rb", "app/components/#{component}.html.erb"]
121
+ rb, erb = if (component_constant = component_to_eject.safe_constantize)
122
+ # If component is a constant, find the source location
123
+ source_location = component_constant.source_location
124
+
125
+ [source_location, source_location.gsub(".rb", ".html.erb")]
126
+ else
127
+ ["app/components/#{component}.rb", "app/components/#{component}.html.erb"]
128
+ end
122
129
 
123
130
  # Return if one of the components doesn't exist
124
131
  if !path_exists?(rb) || !path_exists?(erb)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avo
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.14.1
4
+ version: 3.14.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Marin
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-11-18 00:00:00.000000000 Z
13
+ date: 2024-11-21 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord