angular_sprinkles 0.2.1 → 0.2.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: 63255ac5499bbd7a2c8e7445bbd83abde35e2b9c
4
- data.tar.gz: c094e71015dfec90b47ff9a84bad5002b6cb19b4
3
+ metadata.gz: eed7aee04a4952f676338e250a4cb8f4eca0aac9
4
+ data.tar.gz: 46e54cfb72da69292b61b3093addd93d211aa2e0
5
5
  SHA512:
6
- metadata.gz: 9c037097cb261fbac5ba6cc2c566a986ceaa03374fd3ab39a66771c26409ac98923662dfd84889e7e95ed01e8523e522ab3ff7c65457881632e032c1ad0bdcc1
7
- data.tar.gz: 83a3d681ac5ec8b42059e25be8f58e543827a46b8bfce601152af50912f357e11a187584a661f069771d847627434e1da05941e4fe80b66182bddef8af8fb5e8
6
+ metadata.gz: 2af21d9b5c9d740184e23a5a4fa6ded80b234c4f05f643123b8e3044fa142c71f7ad4827fb53b65080c507508ee743bb8dde4e14df264abfa64df780c7709c53
7
+ data.tar.gz: 2f57f13b8f6010257dee08f6e67e88c1c1d6f4f02026142a91619123cec86592ffd1cb5d5dd10997d16fd0a03073d5b04a9d4cbeb614a56a3535746d5bd10a98
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
@@ -2,11 +2,11 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: angular_sprinkles 0.2.1 ruby lib
5
+ # stub: angular_sprinkles 0.2.2 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "angular_sprinkles"
9
- s.version = "0.2.1"
9
+ s.version = "0.2.2"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
@@ -4,8 +4,14 @@ module AngularSprinkles
4
4
  private
5
5
 
6
6
  def augment_args
7
+ binding = { "ng-model" => @attribute_binding }
8
+
7
9
  @args.tap do |args|
8
- args.second.reverse_merge!({ "ng-model" => @attribute_binding })
10
+ if args.many?
11
+ args.second.reverse_merge!(binding)
12
+ else
13
+ args.push(binding)
14
+ end
9
15
  end
10
16
  end
11
17
  end
@@ -1,8 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe AngularSprinkles::FormBinder::CheckBox do
4
- let(:method) { ->(name, value, *opts) {} }
5
- let(:args) { [:attribute, {}] }
4
+ let(:method) { ->(name, *opts) {} }
5
+ let(:args) { [:attribute] }
6
6
  let(:attribute_binding) { double }
7
7
  let(:object) { double(bind: attribute_binding) }
8
8
  let(:params) { { method: method, args: args, object: object } }
@@ -11,6 +11,10 @@ describe AngularSprinkles::FormBinder::CheckBox do
11
11
  augmented_args = described_class.new(params).call
12
12
  expect(augmented_args.second["ng-model"]).to eq(attribute_binding)
13
13
 
14
+ args.push({})
15
+ augmented_args = described_class.new(params).call
16
+ expect(augmented_args.second["ng-model"]).to eq(attribute_binding)
17
+
14
18
  args.push(1)
15
19
  augmented_args = described_class.new(params).call
16
20
  expect(augmented_args.second["ng-model"]).to eq(attribute_binding)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: angular_sprinkles
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabe Scholz