dao 5.5.2 → 5.6.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,7 @@
3
3
 
4
4
  Gem::Specification::new do |spec|
5
5
  spec.name = "dao"
6
- spec.version = "5.5.2"
6
+ spec.version = "5.6.1"
7
7
  spec.platform = Gem::Platform::RUBY
8
8
  spec.summary = "dao"
9
9
  spec.description = "presenter, conducer, api, and better form objects for you rails' pleasure"
data/lib/dao.rb CHANGED
@@ -11,7 +11,7 @@
11
11
  # dao libs
12
12
  #
13
13
  module Dao
14
- Version = '5.5.2' unless defined?(Version)
14
+ Version = '5.6.1' unless defined?(Version)
15
15
 
16
16
  def version
17
17
  Dao::Version
@@ -123,7 +123,15 @@ module Dao
123
123
 
124
124
  errors.each do |*argv|
125
125
  msgs = Array(argv.pop)
126
+
127
+ # ref: support for key-style of https://github.com/glooko/mongoid-embedded-errors
128
+ #key = Array(argv.pop).flatten.compact.join('.')
129
+ #key = key.to_s.split('.')
130
+ #key.map!{|k| k =~ /\[(\d+)\]/ ? $1 : k}
131
+ #key = prefix + key
132
+
126
133
  key = prefix + Array(argv.pop)
134
+
127
135
  msgs.each{|msg| add(Array(options[:key] || key), msg, options)}
128
136
  end
129
137
  end
@@ -310,7 +310,7 @@ module Dao
310
310
  value_for[false] ||= '0'
311
311
 
312
312
  hidden_options =
313
- options.dup.tap{|o| o.delete(:checked)}
313
+ options.dup.tap{|o| [:checked, :required, :disabled].each{|k| o.delete(k)}}
314
314
 
315
315
  tagz{
316
316
  input_(options_for(hidden_options, :type => :hidden, :name => name, :value => value_for[false])){}
@@ -45,6 +45,16 @@ Testing Dao::Errors do
45
45
  assert compress(actual) == compress(expected)
46
46
  end
47
47
 
48
+ =begin
49
+ testing 'that `nested` errors `nest`' do
50
+ e = Dao::Errors.new
51
+
52
+ e.relay 'foo.bar' => 'is fucked'
53
+
54
+ p e.to_hash
55
+ assert e.to_hash == {'foo' => {'bar' => 'is fucked'}}
56
+ end
57
+ =end
48
58
 
49
59
 
50
60
  protected
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dao
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.5.2
4
+ version: 5.6.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-09-18 00:00:00.000000000 Z
12
+ date: 2017-01-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails