active_model-attribute 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_model/attribute.rb +3 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85c719dfcf136001c87913a016b55757e1dd406b
|
4
|
+
data.tar.gz: 1cd1c057b22067bf047b289ac85276486062c592
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bfd87e04203cbac2e0f342e49920d2bfa9040ad547a2452cc7573c2f723c8eb5544232a27bab1d9b8608e826804f3aafb5f907a75b8c23211d218c821d19f67
|
7
|
+
data.tar.gz: ae3b1ef0c13ca8db9ebd1112876dc34abb2136c255d54f8c206e31f468f474c2e4a87ebc2838f817783341711f317cf9d135d8d8c22d43268aac3908d77ab6d1
|
@@ -23,7 +23,9 @@ module ActiveModel
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def attribute(name, type, **options)
|
26
|
-
|
26
|
+
return if attributes.include?(name)
|
27
|
+
|
28
|
+
attributes << name unless options[:virtual]
|
27
29
|
|
28
30
|
getter = name.to_sym
|
29
31
|
setter = :"#{name}="
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_model-attribute
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Francesco Rodríguez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
109
|
version: '0'
|
110
110
|
requirements: []
|
111
111
|
rubyforge_project:
|
112
|
-
rubygems_version: 2.6.
|
112
|
+
rubygems_version: 2.6.11
|
113
113
|
signing_key:
|
114
114
|
specification_version: 4
|
115
115
|
summary: Declares attribute for Active Model objects
|