Method: ActsAsTable::RecordError#attribute_name
- Defined in:
- app/models/acts_as_table/record_error.rb
#attribute_name ⇒ String
Note:
The attribute name for model-level errors is "base".
Returns the attribute name for this ActsAsTable record error.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'app/models/acts_as_table/record_error.rb', line 14 class RecordError < ::ActiveRecord::Base # @!parse # include ActsAsTable::ValueProvider # include ActsAsTable::ValueProviderAssociationMethods self.table_name = ActsAsTable.record_errors_table # Returns the ActsAsTable record for this error. belongs_to :record, **{ class_name: 'ActsAsTable::Record', counter_cache: 'record_errors_count', inverse_of: :record_errors, required: true, } # Returns the ActsAsTable value for this error or `nil`. # # @return [ActsAsTable::Value, nil] belongs_to :value, **{ class_name: 'ActsAsTable::Value', counter_cache: 'record_errors_count', inverse_of: :record_errors, required: false, } validates :attribute_name, **{ presence: true, } validates :message, **{ presence: true, uniqueness: { scope: ['record_id', 'attribute_name'], }, } end |