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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: acfb0e13856030c00204836441c5481d2b238838
4
- data.tar.gz: 05dbc59c83fcb732bbdadc04f244dc092ef3729e
3
+ metadata.gz: 85c719dfcf136001c87913a016b55757e1dd406b
4
+ data.tar.gz: 1cd1c057b22067bf047b289ac85276486062c592
5
5
  SHA512:
6
- metadata.gz: 65931e37d6de7f9648be28cbc9feaf79c16f6937349cb60d3451cd8c453d352e360e6035a9997cb39992a863568c3e9c0f2267ac97f5cfe2051145010796b35d
7
- data.tar.gz: 27b14282c475e4b138a90839e39a16d924e322f144c67415d6566b4df9e5cda7473b026f5885c098cfa5780d452e826be24184f9a8f7bb32eb943398fa5ded48
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
- attributes << name unless attributes.include?(name)
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.1
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-12 00:00:00.000000000 Z
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.13
112
+ rubygems_version: 2.6.11
113
113
  signing_key:
114
114
  specification_version: 4
115
115
  summary: Declares attribute for Active Model objects