public
Description: object-oriented activerecord validations and machine/human formatting
Clone URL: git://github.com/cainlevy/semantic-attributes.git
100644 15 lines (12 sloc) 0.311 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require 'core_ext/class'
 
ActiveRecord::Base.class_eval do
  include SemanticAttributes::Predicates
  include SemanticAttributes::AttributeFormats
  include ActiveRecord::ValidationRecursionControl
end
 
# localization mock
ActiveRecord::Base.class_eval do
  unless respond_to? :_
    def _(s); s; end
  end
end