Method: Conjoin::ActiveRecord::Form#valid_only?

Defined in:
lib/conjoin/active_record.rb

#valid_only?(*columns) ⇒ Boolean

Returns:

  • (Boolean)


187
188
189
190
191
192
193
# File 'lib/conjoin/active_record.rb', line 187

def valid_only? *columns
  self.valid?
  self.errors.messages.each do |field, message|
    self.errors.delete(field) unless columns.include? field
  end
  !self.errors.present?
end