Skip to content
Browse files

check if ActiveRecord is defined, before trying to use it / Bugfix fo…

…r ActiveRecord less app
  • Loading branch information...
1 parent 67a7ff8 commit 2e49f7bd4a0c6b9879cd3c411e6357d5c6dd0643 @mck9 mck9 committed Mar 26, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/validates_email_format_of.rb
View
6 lib/validates_email_format_of.rb
@@ -181,8 +181,10 @@ def validates_email_format_of(*attr_names)
end
end
else
- class ActiveRecord::Base
- extend ValidatesEmailFormatOf::Validations
+ if defined?(ActiveRecord)
+ class ActiveRecord::Base
+ extend ValidatesEmailFormatOf::Validations
+ end
end
end

1 comment on commit 2e49f7b

@alexdunae

Nice, thank you.

Please sign in to comment.
Something went wrong with that request. Please try again.