inherited_rails_views 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/.rvmrc CHANGED
@@ -1 +1 @@
1
- rvm use --create 1.9.2@irv
1
+ rvm --create use 1.9.2@irv
@@ -23,4 +23,5 @@ Gem::Specification.new do |s|
23
23
 
24
24
  s.add_development_dependency "rspec"
25
25
  s.add_development_dependency "actionpack"
26
+ s.add_development_dependency "pry"
26
27
  end
@@ -1,3 +1,3 @@
1
1
  module InheritedRailsViews
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.2"
3
3
  end
@@ -41,20 +41,25 @@ module InheritedRailsViews
41
41
 
42
42
  private
43
43
  def _set_inherited_attributes(*args)
44
+
45
+
44
46
  # extract the hash attributes
45
47
  options = args.extract_options!
46
48
 
47
- # reject all methods that have no value key
48
- options.select! { |k, v| v[:value].is_a?(String) }
49
-
50
- options.each_pair do |k, v|
51
- v[:type] ||= :text_field
49
+ #first, add the args to the result
50
+ @_inherited_attributes = args.inject({}) do |h, e|
51
+ h[e] = true
52
+ h
52
53
  end
53
54
 
54
- # add array methods to the hash and store the result in @inherited_attributes
55
- @_inherited_attributes = args.inject(options) do |h, e|
56
- h[e] = {:value => e.to_s.titleize, :type => :text_field}
57
- h
55
+ @_inherited_attributes.merge!(options)
56
+
57
+ @_inherited_attributes.keys.each do |k|
58
+ v = @_inherited_attributes[k]
59
+ v = {} if v == true
60
+ v[:value] = k.to_s.titleize if !v.has_key?(:value) or v[:value] == true
61
+ v[:type] ||= :text_field
62
+ @_inherited_attributes[k] = v
58
63
  end
59
64
  end
60
65
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inherited_rails_views
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-16 00:00:00.000000000Z
12
+ date: 2011-09-19 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
16
- requirement: &70140041720960 !ruby/object:Gem::Requirement
16
+ requirement: &70306907786640 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70140041720960
24
+ version_requirements: *70306907786640
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &70140041720540 !ruby/object:Gem::Requirement
27
+ requirement: &70306907785880 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70140041720540
35
+ version_requirements: *70306907785880
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: actionpack
38
- requirement: &70140041720120 !ruby/object:Gem::Requirement
38
+ requirement: &70306907785240 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,18 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70140041720120
46
+ version_requirements: *70306907785240
47
+ - !ruby/object:Gem::Dependency
48
+ name: pry
49
+ requirement: &70306907766220 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: *70306907766220
47
58
  description:
48
59
  email:
49
60
  - robin@wenglewski.de