activeupdate 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/activeupdate.rb +2 -5
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e2ab8ba417c9ad86b9cf1e83c6dcc1c998e95e30
4
- data.tar.gz: da8e0c9e862a75cb7e73eb4b5b4d72560da9d1b2
3
+ metadata.gz: 12be84f7fe34db02cfefc508d0f9878548e62dbf
4
+ data.tar.gz: 11ce00996b963e365797df1ba0af6cb0c4ac672f
5
5
  SHA512:
6
- metadata.gz: 7cb85304fa97be3baa494cbceb4977dd2052d17197181cc0518292c0070d4feb86350f3806b5988b6151a778d398f782c7db5d658adee3618a59298b2ba0c237
7
- data.tar.gz: a3c353efafa7755997efbfbda96e2a64a27b93a3c5edfccf1d2706b7869508bce9234ecb945ae8a3cb05045b181938fbc69a64be2e651350b56400478f7eab23
6
+ metadata.gz: 398b69c0a128312639e62a025af9e91423591d01c2b1bf6d5d9551b5700d748453698721c0fdd3f57c2b1fc3a250585e7d9311c532a63a878751355655d9eb82
7
+ data.tar.gz: edd12172fc6a76a7abbf4e9be88857606b5588d4a35ec05af9448c31140b07c19b8b77e83acbbe1c8f08535205becde6910df3dfd4fd4c173cb4e42e816d733e
data/lib/activeupdate.rb CHANGED
@@ -19,11 +19,8 @@ module ActiveRecordExtension
19
19
 
20
20
  attributes.each_with_index do |attribute, index|
21
21
  attribute.each do |key, value|
22
- if attribute_hash[key]
23
- attribute_hash[key].when(ids[index]).then(value)
24
- else
25
- attribute_hash[key] = Arel::Nodes::Case.new(resources_id).when(ids[index]).then(value)
26
- end
22
+ attribute_hash[key] = Arel::Nodes::Case.new(resources_id) unless attribute_hash[key]
23
+ attribute_hash[key].when(ids[index]).then(value)
27
24
  end
28
25
  end
29
26
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeupdate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew H. Carpenter
@@ -40,6 +40,6 @@ rubyforge_project:
40
40
  rubygems_version: 2.5.1
41
41
  signing_key:
42
42
  specification_version: 4
43
- summary: activerecord extension to facilitate updating multiple records with single
44
- operation
43
+ summary: activerecord extension to facilitate updating multiple records (leveraging
44
+ case statements)
45
45
  test_files: []