create_custom_attributes 0.5.4 → 0.5.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: fa05420e609addaadab90b10b1652c823c4caa58
4
- data.tar.gz: 58b27a4fa5573fb270147a949ac160f2a4f0f45f
3
+ metadata.gz: f69596f4a6689409538693c41d6fff7bb3b76bc0
4
+ data.tar.gz: 90013847fba6e657bb13023fdb994b751c898ec7
5
5
  SHA512:
6
- metadata.gz: 880b1321fa603a38fbaf792e503a9f869b88fc8f98f3d62d0d7106fc11bab9de7b16782670540807614025f55322854d8da4a9cbcb71c3ce9ce5790452ddface
7
- data.tar.gz: 943d0eeaf295878f673bafaab924ba87eb087946b0fed48158b867489014a7bf0557a40dd0413254e15debe9ec4f02b1aea580bf17ccd576bb55627349937c4f
6
+ metadata.gz: 8595942a2702a6655a81bf7ff05a01089eccf13b14cc9b772a173780792ff2c1aa78425e0e525c6543180e862e332b04900c32a688284085dbe01e6c5937791f
7
+ data.tar.gz: b7185400c440089936b44dc621ea3556b855f060ef796aba0bb94ad88757e44f2aff786cc52e2307e41b4b237599fd035d56b50ea91508f911e5fad91f7a1b13
@@ -24,6 +24,12 @@ module CustomAttributes
24
24
  end
25
25
  end
26
26
 
27
+ def value
28
+ return read_attribute(:value) if new_record?
29
+
30
+ read_attribute(:value) || custom_field.default
31
+ end
32
+
27
33
  def true?
28
34
  value == '1'
29
35
  end
@@ -1,3 +1,3 @@
1
1
  module CustomAttributes
2
- VERSION = '0.5.4'.freeze
2
+ VERSION = '0.5.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: create_custom_attributes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Grützmacher
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-24 00:00:00.000000000 Z
11
+ date: 2018-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -136,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  version: '0'
137
137
  requirements: []
138
138
  rubyforge_project:
139
- rubygems_version: 2.6.14
139
+ rubygems_version: 2.5.2
140
140
  signing_key:
141
141
  specification_version: 4
142
142
  summary: Manage and Search Custom Attributes, Fields and Value for any ActiveRecord