app/models/fine_print/signature.rb in fine_print-2.3.1 vs app/models/fine_print/signature.rb in fine_print-3.0.0
- old
+ new
@@ -1,15 +1,15 @@
module FinePrint
class Signature < ActiveRecord::Base
- belongs_to :contract, :inverse_of => :signatures
- belongs_to :user, :polymorphic => true
+ belongs_to :contract, inverse_of: :signatures
+ belongs_to :user, polymorphic: true
- validate :contract_published, :on => :create
+ validate :contract_published, on: :create
- validates :contract, :presence => true
- validates :contract_id, :uniqueness => {:scope => [:user_type, :user_id]}
- validates :user, :presence => true
+ validates :contract, presence: true
+ validates :contract_id, uniqueness: { scope: [:user_type, :user_id] }
+ validates :user, presence: true
default_scope { order(:contract_id, :user_type, :user_id) }
protected
@@ -17,11 +17,12 @@
# Validation #
##############
def contract_published
return if contract.is_published?
- errors.add(:contract, I18n.t(
- 'fine_print.signature.errors.contract.not_published'))
+ errors.add(
+ :contract, I18n.t('fine_print.signature.errors.contract.not_published')
+ )
false
end
end
end