in domainpost.rb i have this:
class Domainpost < ActiveRecord::Base
attr_accessible :content, :additiona, :registerdate, :expiredate, :registerin, :price
belongs_to :user
before_save { |domainpost| domainpost.content = content.downcase }
before_validation :pricecheck
validates :price, allow_blank: false, presence: true
default_scope order: 'domainposts.created_at DESC'
def pricecheck
if price.blank?
price = 'no price'
end
end
and it isnt work when price in post is blank after save is stil blank, any idea what i do wrong?