Module: Nexx::AdvancedErrors::FullMessages
- Defined in:
- lib/advanced_errors.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
16 17 18 19 |
# File 'lib/advanced_errors.rb', line 16 def self.included(base) base.class_eval { alias_method :full_messages_without_ignore_attribute, :full_messages } base.class_eval { alias_method :full_messages, :full_messages_with_ignore_attribute } end |
Instance Method Details
#full_messages_with_ignore_attribute ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/advanced_errors.rb', line 4 def error = ActiveRecord::Errors.new @base self.each do |attribute, | unless .match(/^\^/) error.add attribute, else error.add_to_base [1...length] #Adding to base will mean that the attribute will not be displayed end end error. end |