spec/fake_app/company.rb in validates_cnpj-1.1.3 vs spec/fake_app/company.rb in validates_cnpj-2.0.0

- old
+ new

@@ -1,3 +1,15 @@ -class Company < ActiveRecord::Base +class Company + include ActiveModel::Validations + include ActiveModel::Conversion + extend ActiveModel::Naming + + attr_accessor :cnpj, :name + validates :cnpj, :cnpj => true + + def initialize(attributes = {}) + attributes.each do |key, value| + instance_variable_set("@#{key}", value) + end + end end \ No newline at end of file