effective_bootstrap 0.4.4 → 0.4.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
  SHA1:
3
- metadata.gz: 35e413478812c30365ec0e7a5c84e8af1377dfd1
4
- data.tar.gz: 47bdcbb54bf6c006657c502f75d36d9f03eda1d3
3
+ metadata.gz: c2469342de9d3e1a00a7bbda6ec5867dfcc246c3
4
+ data.tar.gz: 9f7a28c645d1ca83eb8ea50afe62f1fcb34948b9
5
5
  SHA512:
6
- metadata.gz: b94edbf34d889568346e8bf49a15e96a7ffe0c8891e1286f5e4b510753224eca910a6e2e83475ac2350ebb028d8029d40c5db12745952160fbf725a1633df40d
7
- data.tar.gz: 62a53f3d7b2daa9d765f349666e543609f1626aa1f477baf9c2e07b02e0165a31b8631a72261bbfb6fc04780eab455b89b716f7a771911d6c3391c023f56f958
6
+ metadata.gz: 03514b33df32c0cb77d801e4f24e93f327723271554329b4fe7a08a2cf43d6fd871ec75b44a8af7998d13dbc402e323d33bf2ef0a03832c930442e9c9a51d5cb
7
+ data.tar.gz: 09e81df8639a8e1933be6237e60cd74ea030164255bcb116f24105716628e5d4efb4bca3ab731fe1096c5c68bebe0d87259e2ff24762887829030ef8e2da1f8c
@@ -254,7 +254,8 @@ module Effective
254
254
  end
255
255
 
256
256
  def value
257
- object.public_send(name) if object.respond_to?(name)
257
+ @_value ||= (options.delete(:value) || options[:input]&.delete(:value))
258
+ @_value ||= (object.public_send(name) if object.respond_to?(name))
258
259
  end
259
260
 
260
261
  def unique_id(item = nil)
@@ -32,12 +32,11 @@ module Effective
32
32
 
33
33
  checked = options[:input].delete(:checked)
34
34
  selected = options[:input].delete(:selected)
35
- passed_value = options[:input].delete(:value)
36
35
  include_blank = options[:input].delete(:include_blank)
37
36
 
38
37
  @collection_options = {
39
- checked: [checked, selected, passed_value, polymorphic_value, value].find { |value| value != nil },
40
- selected: [selected, checked, passed_value, polymorphic_value, value].find { |value| value != nil },
38
+ checked: [checked, selected, polymorphic_value, value].find { |value| value != nil },
39
+ selected: [selected, checked, polymorphic_value, value].find { |value| value != nil },
41
40
  include_blank: include_blank
42
41
  }.compact
43
42
  end
@@ -13,15 +13,13 @@ module Effective
13
13
  def build_input(&block)
14
14
  content = if block_given?
15
15
  capture(&block)
16
- elsif options[:input][:value]
17
- options[:input].delete(:value)
18
16
  elsif resource_path
19
17
  link_to(value, resource_path, title: value.to_s)
20
18
  else
21
19
  value
22
20
  end
23
21
 
24
- content_tag(:p, content, options[:input].except(:readonly, :required, :value).merge(id: tag_id))
22
+ content_tag(:p, content, options[:input].except(:readonly, :required).merge(id: tag_id))
25
23
  end
26
24
 
27
25
  def resource_path
@@ -1,3 +1,3 @@
1
1
  module EffectiveBootstrap
2
- VERSION = '0.4.4'.freeze
2
+ VERSION = '0.4.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-18 00:00:00.000000000 Z
11
+ date: 2019-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails