Skip to content

Commit a8134ee

Browse files
committed
Fix error messages
1 parent 0662cee commit a8134ee

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

app/models/opportunity.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class Opportunity < ActiveRecord::Base
4646
validates :tag_list, with: :tags_within_length
4747
validates :location, presence: true, allow_blank: false
4848
validates :location_city, presence: true, allow_blank: false, unless: lambda { location && anywhere?(location) }
49-
validates :salary, presence: true, numericality: true, inclusion: 0..800_000, allow_blank: true
49+
validates :salary, presence: true, numericality: {only_integer: true, greater_than: 0, less_than_or_equal_to: 800000}, allow_blank: true
5050

5151
before_validation :set_location_city
5252
before_save :update_cached_tags
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
-if target.errors.any?
22
.errors
3-
%h4==#{pluralize(target.errors.count, "error")} prohibited this user from being saved:
3+
%h4
4+
= "#{pluralize(target.errors.count, "error")} prohibited this #{target.class.model_name.human.downcase} from being saved:"
45
%ul
56
-target.errors.full_messages.each do |message|
67
%li=raw message

0 commit comments

Comments
 (0)