judge 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -1
- data/VERSION +1 -1
- data/judge.gemspec +2 -2
- data/lib/judge.rb +4 -1
- data/lib/judge/utils.rb +8 -5
- data/test/dummy/log/development.log +37 -0
- metadata +4 -4
data/README.md
CHANGED
@@ -11,8 +11,9 @@ See http://joecorcoran.github.com/judge for documentation.
|
|
11
11
|
License
|
12
12
|
-------
|
13
13
|
|
14
|
-
|
14
|
+
Released under an MIT license (see LICENSE.txt).
|
15
15
|
|
16
|
+
http://tribesports.com
|
16
17
|
http://blog.joecorcoran.co.uk
|
17
18
|
|
18
19
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.1
|
data/judge.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{judge}
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Joe Corcoran"]
|
12
|
-
s.date = %q{2011-07-
|
12
|
+
s.date = %q{2011-07-26}
|
13
13
|
s.description = %q{Validate forms in-place using your model validations}
|
14
14
|
s.email = %q{joe@tribesports.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/judge.rb
CHANGED
@@ -2,4 +2,7 @@ require File.dirname(__FILE__) + '/judge/utils'
|
|
2
2
|
require File.dirname(__FILE__) + '/judge/form'
|
3
3
|
|
4
4
|
::ActionView::Helpers::FormBuilder.send(:include, Judge::FormBuilder)
|
5
|
-
|
5
|
+
|
6
|
+
module ApplicationHelper
|
7
|
+
include Judge::FormHelper
|
8
|
+
end
|
data/lib/judge/utils.rb
CHANGED
@@ -2,11 +2,14 @@ module Judge
|
|
2
2
|
module Utils
|
3
3
|
|
4
4
|
def self.jsonify_validators(object, method)
|
5
|
-
object
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
validators = object.class.validators_on(method)
|
6
|
+
validators = validators.collect do |validator|
|
7
|
+
{
|
8
|
+
:kind => validator.kind.to_s,
|
9
|
+
:options => validator.options.reject{ |key| [:if, :on, :unless, :tokenizer].include?(key) }
|
10
|
+
}
|
11
|
+
end
|
12
|
+
validators.to_json
|
10
13
|
end
|
11
14
|
|
12
15
|
end
|
@@ -271,3 +271,40 @@ Migrating to CreateContinentCountryAndCityTables (20110725082530)
|
|
271
271
|
[1m[36mSQL (1.3ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20110624115516')[0m
|
272
272
|
[1m[35mSQL (1.2ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20110724201117')
|
273
273
|
[1m[36mSQL (1.3ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20110724201548')[0m
|
274
|
+
|
275
|
+
|
276
|
+
Started GET "/posts/new" for 127.0.0.1 at 2011-07-25 18:59:00 +0100
|
277
|
+
|
278
|
+
ActionController::RoutingError (No route matches "/posts/new"):
|
279
|
+
|
280
|
+
|
281
|
+
Rendered /Users/joecorcoran/.rvm/gems/ruby-1.9.2-head/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.1ms)
|
282
|
+
|
283
|
+
|
284
|
+
Started GET "/foos/new" for 127.0.0.1 at 2011-07-25 18:59:06 +0100
|
285
|
+
Processing by FoosController#new as HTML
|
286
|
+
[1m[36mSQL (0.6ms)[0m [1m SELECT name
|
287
|
+
FROM sqlite_master
|
288
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
289
|
+
[0m
|
290
|
+
[1m[35mSQL (0.2ms)[0m SELECT name
|
291
|
+
FROM sqlite_master
|
292
|
+
WHERE type = 'table' AND NOT name = 'sqlite_sequence'
|
293
|
+
WARNING: Can't mass-assign protected attributes: id
|
294
|
+
WARNING: Can't mass-assign protected attributes: id
|
295
|
+
WARNING: Can't mass-assign protected attributes: id
|
296
|
+
Rendered foos/new.html.erb within layouts/application (44.7ms)
|
297
|
+
Completed in 221ms
|
298
|
+
|
299
|
+
ActionView::Template::Error (undefined method `validated_form_for' for #<#<Class:0x00000102d4f258>:0x00000102d48e80>):
|
300
|
+
1: <h1>New foo</h1>
|
301
|
+
2:
|
302
|
+
3: <%= validated_form_for(@foo) do |f| %>
|
303
|
+
4: <% if @foo.errors.any? %>
|
304
|
+
5: <div id="error_explanation">
|
305
|
+
6: <h2><%= pluralize(@foo.errors.count, "error") %> prohibited this foo from being saved:</h2>
|
306
|
+
app/views/foos/new.html.erb:3:in `_app_views_foos_new_html_erb__1838023501461859710_2171221340__2905132362480950973'
|
307
|
+
|
308
|
+
Rendered /Users/joecorcoran/.rvm/gems/ruby-1.9.2-head/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.5ms)
|
309
|
+
Rendered /Users/joecorcoran/.rvm/gems/ruby-1.9.2-head/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (2.7ms)
|
310
|
+
Rendered /Users/joecorcoran/.rvm/gems/ruby-1.9.2-head/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (14.3ms)
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
8
|
+
- 1
|
9
|
+
version: 0.3.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Joe Corcoran
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-07-
|
17
|
+
date: 2011-07-26 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -239,7 +239,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
239
239
|
requirements:
|
240
240
|
- - ">="
|
241
241
|
- !ruby/object:Gem::Version
|
242
|
-
hash:
|
242
|
+
hash: 506679334507431813
|
243
243
|
segments:
|
244
244
|
- 0
|
245
245
|
version: "0"
|