inline_forms 1.1.17 → 1.1.18
Sign up to get free protection for your applications and to get access to all the features.
data/lib/inline_forms.rb
CHANGED
@@ -2,6 +2,8 @@ require ('inline_forms/version.rb')
|
|
2
2
|
# InlineForms is a Rails Engine that let you setup an admin interface quick and
|
3
3
|
# easy. Please install it as a gem or include it in your Gemfile.
|
4
4
|
module InlineForms
|
5
|
+
# load stuff in lib
|
6
|
+
config.autoload_paths += Dir["lib", "lib/**/"]
|
5
7
|
# DEFAULT_COLUMN_TYPES holds the standard ActiveRecord::Migration column types.
|
6
8
|
# This list provides compatability with the standard types, but we add our own
|
7
9
|
# later in 'Special Column Types'.
|
@@ -142,6 +144,7 @@ module InlineForms
|
|
142
144
|
paths["app/models"] << "lib/app/models"
|
143
145
|
paths["app/views"] << "lib/app/views"
|
144
146
|
paths["app/assets"] << "lib/app/assets"
|
147
|
+
paths["lib"] << "lib/validators"
|
145
148
|
end
|
146
149
|
|
147
150
|
end
|
data/lib/inline_forms/version.rb
CHANGED
@@ -0,0 +1,8 @@
|
|
1
|
+
# http://railscasts.com/episodes/211-validations-in-rails-3
|
2
|
+
class EmailFormatValidator < ActiveModel::EachValidator
|
3
|
+
def validate_each(object, attribute, value)
|
4
|
+
unless value =~ /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i
|
5
|
+
object.errors[attribute] << (options[:message] || "is not formatted properly")
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inline_forms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 55
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
9
|
+
- 18
|
10
|
+
version: 1.1.18
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ace Suares
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-01-
|
18
|
+
date: 2012-01-06 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rspec-rails
|
@@ -197,6 +197,7 @@ files:
|
|
197
197
|
- lib/otherstuff/diffie
|
198
198
|
- lib/otherstuff/mkrole
|
199
199
|
- lib/otherstuff/roles_users.sql
|
200
|
+
- lib/validators/email_format_validator.rb
|
200
201
|
- test/helper.rb
|
201
202
|
- test/test_inline_forms.rb
|
202
203
|
homepage: http://github.com/acesuares/inline_forms
|