Sha256: 18c5570c7df4f6fecc1790d36c3bae23dfa36f481e193cf97788d363cc542465

Contents?: true

Size: 353 Bytes

Versions: 43

Compression:

Stored size: 353 Bytes

Contents

module PaidUp::Validators
  class RolifyRows < ActiveModel::Validator
    def validate(record)
      if record.send(options[:field]) == options[:comparison] && !ActiveRecord::Base.connection.table_exists?(record.send(options[:found_in]))
        record.errors[options[:found_in]] << :when_using_rolify_rows_table_must_exist.l
      end
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
paid_up-0.9.13 lib/paid_up/validators/rolify_rows.rb
paid_up-0.9.12 lib/paid_up/validators/rolify_rows.rb
paid_up-0.9.11 lib/paid_up/validators/rolify_rows.rb
paid_up-0.9.10 lib/paid_up/validators/rolify_rows.rb
paid_up-0.9.9 lib/paid_up/validators/rolify_rows.rb
paid_up-0.9.8 lib/paid_up/validators/rolify_rows.rb
paid_up-0.9.7 lib/paid_up/validators/rolify_rows.rb
paid_up-0.9.6 lib/paid_up/validators/rolify_rows.rb
paid_up-0.9.5 lib/paid_up/validators/rolify_rows.rb
paid_up-0.9.4 lib/paid_up/validators/rolify_rows.rb
paid_up-0.9.3 lib/paid_up/validators/rolify_rows.rb
paid_up-0.9.2 lib/paid_up/validators/rolify_rows.rb
paid_up-0.9.1 lib/paid_up/validators/rolify_rows.rb
paid_up-0.9.0 lib/paid_up/validators/rolify_rows.rb
paid_up-0.8.1 lib/paid_up/validators/rolify_rows.rb
paid_up-0.7.11 lib/paid_up/validators/rolify_rows.rb
paid_up-0.7.10 lib/paid_up/validators/rolify_rows.rb
paid_up-0.7.9 lib/paid_up/validators/rolify_rows.rb
paid_up-0.7.8 lib/paid_up/validators/rolify_rows.rb
paid_up-0.7.7 lib/paid_up/validators/rolify_rows.rb