administrate-field-globalize-string 0.0.1.alpha1 → 0.0.1.alpha3

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: 01bafa84d242e51bd45e8353baa2b67c90ff94ad7de4dbbc5197e5e5d3678440
4
- data.tar.gz: 3148b831faf2eb3f6e468172c68b12fa0053c6db6b21fdc9b40e458282a423f9
3
+ metadata.gz: dc55d6c17469561087a728c56661c9497b77ca00f9c0925eca37d661e4c66c44
4
+ data.tar.gz: feff2590a920c998d65c39a594506138050e94c18981291f40005e99ab829a62
5
5
  SHA512:
6
- metadata.gz: fd212e46de850ef6c9980f17674e5d17ca6e53eb0a3da74b34a49cd29eb636d260dc4a35ac57ac61a09552cabeb8a9410a6dcb9b9d3a6a38bd86a3c9c3a93b3e
7
- data.tar.gz: '08f256228514a9fad5a7408014aeba0992d65e8fdcfd061c356b51158b09fc954f8862fa3600b2d2440a597a80ce4d86b9af85cb4e64555595cd86778c634018'
6
+ metadata.gz: e7e4e4add7132fa9ff27477bd3ffef4decba28019c19e743ddd7715dd53cab12315ea74bae24567bf3f2e093eef1aeb7d9350d44c40f41819ca132438836dd65
7
+ data.tar.gz: aad2b70db5ba86b5920576df06fa8fa05237d01cd9ebe23cb1921541a674cd2d0e168ad1bba1104ea64f9b34b5a99d843541cb4adcb01d88a8d625bca2db4209
@@ -3,7 +3,7 @@
3
3
  </div>
4
4
  <div class="field-unit__field">
5
5
  <% I18n.available_locales.each do |locale| %>
6
- <%= f.text_field "#{field.attribute}_#{locale.downcase}".to_s %>
6
+ <%= f.text_field "#{field.attribute}_#{locale}".downcase.underscore %>
7
7
  (<%= locale %>)
8
8
  <% end %>
9
9
  </div>
@@ -1 +1 @@
1
- <%= field.to_s %>
1
+ <%= field.truncate %>
@@ -9,7 +9,9 @@ module Administrate
9
9
  end
10
10
 
11
11
  def self.permitted_attribute(attr, _options = nil)
12
- I18n.available_locales.map { |locale| "#{attr}_#{locale.downcase}" }
12
+ I18n.available_locales.map do |locale|
13
+ "#{attr}_#{locale}".downcase.underscore
14
+ end
13
15
  end
14
16
 
15
17
  def truncate
@@ -24,6 +26,10 @@ module Administrate
24
26
  true
25
27
  end
26
28
 
29
+ def to_partial_path
30
+ "/fields/globalize/string/#{page}"
31
+ end
32
+
27
33
  private
28
34
 
29
35
  def truncation_length
@@ -4,11 +4,11 @@ describe Administrate::Field::Globalize::String do
4
4
  describe "#to_partial_path" do
5
5
  it "returns a partial based on the page being rendered" do
6
6
  page = :show
7
- field = Administrate::Field::Globalize::String.new(:string, "/a.jpg", page)
7
+ field = Administrate::Field::Globalize::String.new(:name, "foo", page)
8
8
 
9
9
  path = field.to_partial_path
10
10
 
11
- expect(path).to eq("/fields/string/#{page}")
11
+ expect(path).to eq("/fields/globalize/string/#{page}")
12
12
  end
13
13
  end
14
14
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: administrate-field-globalize-string
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.alpha1
4
+ version: 0.0.1.alpha3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Armin Kirchner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-10 00:00:00.000000000 Z
11
+ date: 2018-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: administrate