tybo 0.0.4 → 0.0.5

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: 7dda7057de9c78f6a0cb5690b4266a81c0fcfafb31b2198832a6d66ee8ed685f
4
- data.tar.gz: 13f91f07c1602ee7c91103d1722034a4ba3217644b91041297d59ee20b4273fb
3
+ metadata.gz: 91fb59c76c56ea609b93d85cca672305dac0a42875fbd9da8a1b68340c8c5680
4
+ data.tar.gz: acb7e7c3f088b8db387a35c16ec066c083d96fee5635ebb277fe4badddc07db5
5
5
  SHA512:
6
- metadata.gz: 134eb8ec6fd95f88c5dcc4776e2dab51e218a48af855b9d563ca596119f0ec049980ef62daed8e134c565a7298ee124da9fec6b8220c57e0b38d48d5290bbb92
7
- data.tar.gz: 3821bab4fe455063833559ae562f459ab6686868b6ad7785d09ae6c7f0876cbe20c265f55bd421f3bc9368c923457cbaf7958bc0605c9fec8842df84a39a086f
6
+ metadata.gz: 659f38ba69978f6963f0fe16fdde1e25fbb648473ad69026225a230677865dec508fd2aa25d4bf822a57f035816bb772153ae2ae20055da508f08145bc23f4c4
7
+ data.tar.gz: 4a9fefbf4ca44927feadda09778bc2a8cf68a9602273e11f9a62974af664ee835bf492a58b0bbc91a6feac5d882c084d0c0281d1a6d38752eb09b95259ab4430
@@ -59,7 +59,7 @@ class BoGenerator < Rails::Generators::NamedBase
59
59
  params["#{col.name.to_s.remove('rich_text_' )}".to_sym] = nil
60
60
  end
61
61
  has_many_assoc&.map do |association|
62
- params["#{association.class_name.underscore}_ids".to_sym] = []
62
+ params["#{association.name.to_s.singularize}_ids".to_sym] = []
63
63
  end
64
64
  params
65
65
  end
@@ -6,23 +6,23 @@
6
6
  <%- end -%>
7
7
  <!-- belongs_to Associations -->
8
8
  <%- belongs_to_assoc.each do |association| -%>
9
- <%%= f.association :<%= association.name %>, collection: <%= association.class_name %>.all.map { |item| [item.<%=bo_model_title(association.class_name.constantize)%>, item.id] } %>
9
+ <%%= f.association :<%= association.name.to_s.singularize %>, collection: <%= association.klass.name %>.all.map { |item| [item.<%=bo_model_title(association.klass.name.constantize)%>, item.id] } %>
10
10
  <%- end -%>
11
11
  <!-- has_one Associations -->
12
12
  <%- has_one_assoc.each do |association| -%>
13
13
  <%- if association.options[:class_name] == "ActionText::RichText" -%>
14
- <%%= f.rich_text_area :<%= association.name.to_s.remove('rich_text_' )%> %>
14
+ <%%= f.rich_text_area :<%= association.name.to_s.singularize.to_s.remove('rich_text_' )%> %>
15
15
  <%- else -%>
16
- <%%= f.input :<%= association.foreign_key %>, collection: <%= association.class_name %>.all.map { |item| [item.<%=bo_model_title(association.class_name.constantize)%>, item.id] } %>
16
+ <%%= f.input :<%= association.foreign_key %>, collection: <%= association.klass.name %>.all.map { |item| [item.<%=bo_model_title(association.klass.name.constantize)%>, item.id] } %>
17
17
  <%- end -%>
18
18
  <%- end -%>
19
19
 
20
20
  <!-- has_many Associations -->
21
21
  <%- has_many_assoc.each do |association| -%>
22
22
  <div class="my-5 select">
23
- <label class="block text-sm font-medium text-gray-700 string optional text-sm font-medium text-gray-600" for="<%= "#{class_name.underscore}_#{association.class_name.underscore}_ids" %>"><%= association.class_name.underscore%></label>
24
- <%%= f.select :<%= "#{association.class_name.underscore}_ids" %>,
25
- <%= association.class_name %>.all.map { |item| [item.<%=bo_model_title(association.class_name.constantize)%>, item.id] },
23
+ <label class="block text-sm font-medium text-gray-700 string optional text-sm font-medium text-gray-600" for="<%= "#{class_name.underscore}_#{association.name.to_s.singularize}_ids" %>"><%= association.name.to_s.singularize%></label>
24
+ <%%= f.select :<%= "#{association.name.to_s.singularize}_ids" %>,
25
+ <%= association.klass.name %>.all.map { |item| [item.<%=bo_model_title(association.klass.name.constantize)%>, item.id] },
26
26
  { include_blank: true },
27
27
  multiple: true,
28
28
  data: { controller: 'ts--select' } %>
data/lib/tybo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tybo
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tybo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michel Delpierre