property_sets 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -15,34 +15,33 @@ module ActionView
15
15
  options[:name] = "#{model_name}[property_sets][#{property_set}][#{method}]"
16
16
  @template.check_box(model_name, "property_sets_#{property_set}_#{method}", options, checked_value, unchecked_value)
17
17
  end
18
- end
19
18
 
20
- class FormBuilder
21
- class PropertySetFormBuilderProxy < Delegator
22
- attr_accessor :builder
23
- attr_accessor :property_set
19
+ class FormBuilder
20
+ class PropertySetFormBuilderProxy < Delegator
21
+ attr_accessor :builder
22
+ attr_accessor :property_set
24
23
 
25
- def initialize(property_set, builder)
26
- self.property_set = property_set
27
- self.builder = builder
28
- end
24
+ def initialize(property_set, builder)
25
+ self.property_set = property_set
26
+ self.builder = builder
27
+ end
29
28
 
30
- def __getobj__
31
- builder
32
- end
29
+ def __getobj__
30
+ builder
31
+ end
33
32
 
34
- def check_box(property, options = {}, checked_value = "1", unchecked_value = "0")
35
- builder.property_set_check_box(property_set, property, options, checked_value, unchecked_value)
33
+ def check_box(property, options = {}, checked_value = "1", unchecked_value = "0")
34
+ builder.property_set_check_box(property_set, property, options, checked_value, unchecked_value)
35
+ end
36
36
  end
37
- end
38
37
 
39
- def property_set(identifier)
40
- PropertySetFormBuilderProxy.new(identifier, self)
41
- end
38
+ def property_set(identifier)
39
+ PropertySetFormBuilderProxy.new(identifier, self)
40
+ end
42
41
 
43
- def property_set_check_box(property_set, property, options, checked_value, unchecked_value)
44
- @template.property_set_check_box(@object_name, property_set, property, objectify_options(options), checked_value, unchecked_value)
42
+ def property_set_check_box(property_set, property, options, checked_value, unchecked_value)
43
+ @template.property_set_check_box(@object_name, property_set, property, objectify_options(options), checked_value, unchecked_value)
44
+ end
45
45
  end
46
46
  end
47
47
  end
48
-
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{property_sets}
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Morten Primdahl"]
@@ -171,8 +171,8 @@ class TestPropertySets < ActiveSupport::TestCase
171
171
 
172
172
  context "view construction" do
173
173
  should "provide a form builder proxy" do
174
- proxy = ActionView::FormBuilder.new.property_set(:foo)
175
- assert proxy.is_a?(ActionView::FormBuilder::PropertySetFormBuilderProxy)
174
+ proxy = ActionView::Helpers::FormBuilder.new("hi", "hi", "hi", nil, nil).property_set(:foo)
175
+ assert proxy.is_a?(ActionView::Helpers::FormBuilder::PropertySetFormBuilderProxy)
176
176
  assert_equal :foo, proxy.property_set
177
177
  proxy.builder.expects(:property_set_check_box).once.with(:foo, :bar, {}, "1", "0")
178
178
  proxy.check_box(:bar)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: property_sets
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Morten Primdahl