Skip to content

Commit

Permalink
algumas validações com delete erroneamente
Browse files Browse the repository at this point in the history
  • Loading branch information
clairton committed Nov 18, 2011
1 parent 7e50b01 commit 66c8d8e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/models/goods/additional/value.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class Goods::Additional::Value < ActiveRecord::Base
belongs_to :goods_additional_type, :class_name => "Goods::Additional::Type",:foreign_key => "goods_additional_type_id"
has_one :transaction_goods_additional, :class_name => "Transaction::Goods::Additional",:foreign_key => "goods_additional_value_id"
has_one :transaction_tot, :class_name => "Transaction::Tot", :foreign_key => "goods_additional_value_id"
has_one :transaction_goods_additional, :class_name => "Transaction::Goods::Additional",:foreign_key => "goods_additional_value_id", :dependent => :destroy
has_one :transaction_tot, :class_name => "Transaction::Tot", :foreign_key => "goods_additional_value_id", :dependent => :destroy
validates_presence_of :goods_additional_type_id
validates_associated :goods_additional_type, :class_name => "Goods::Additional::Type",:foreign_key => "goods_additional_type_id"
end
Expand Down
4 changes: 2 additions & 2 deletions app/models/participant/type.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class Participant::Type < ActiveRecord::Base
has_many :transaction_participant, :class_name => "Transaction::Participant", :foreign_key => "participant_type_id", :dependent => :destroy
belongs_to :participantPerson, :class_name => "Participant::Person", :foreign_key => "participant_person_id"
validates_associated :participantPerson, :class_name => "Participant::Person", :foreign_key => "participant_person_id"
belongs_to :participant_person, :class_name => "Participant::Person", :foreign_key => "participant_person_id"
validates_associated :participant_person, :class_name => "Participant::Person", :foreign_key => "participant_person_id"
validates_presence_of :participant_person_id
validates_uniqueness_of :participant_person_id, :scope => :type
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/transaction/taxe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class Transaction::Taxe < ActiveRecord::Base
belongs_to :taxe_value, :class_name => "Taxe::Value", :dependent => :destroy , :foreign_key => "taxe_value_id"
validates_presence_of :transaction_record_id
validates_presence_of :taxe_value_id
validates_associated :taxe_value, :class_name => "Taxe::Value", :dependent => :destroy , :foreign_key => "taxe_value_id"
validates_associated :taxe_value, :class_name => "Taxe::Value", :foreign_key => "taxe_value_id"
validates_associated :transaction_record, :class_name => "Transaction::Record", :foreign_key => "transaction_record_id"
validates_uniqueness_of :taxe_value_id
end
2 changes: 1 addition & 1 deletion app/models/transaction/tot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class Transaction::Tot < ActiveRecord::Base
belongs_to :goods_additional_value, :class_name => "Goods::Additional::Value", :foreign_key => "goods_additional_value_id", :dependent => :destroy
validates_presence_of :transaction_record_id, :goods_additional_value_id
validates_associated :transaction_record, :class_name => "Transaction::Record", :foreign_key => "transaction_record_id"
validates_associated :goods_additional_value, :class_name => "Goods::Additional::Value", :foreign_key => "goods_additional_value_id", :dependent => :destroy
validates_associated :goods_additional_value, :class_name => "Goods::Additional::Value", :foreign_key => "goods_additional_value_id"
validates_uniqueness_of :goods_additional_value_id
end

2 changes: 1 addition & 1 deletion app/models/transaction/xml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
class Transaction::Xml < ActiveRecord::Base
belongs_to :transaction_record, :class_name => 'Transaction::Record', :dependent => :destroy , :foreign_key => "transaction_record_id"
validates_uniqueness_of :transaction_record_id, :name
validates_associated :transaction_record, :class_name => 'Transaction::Record', :dependent => :destroy , :foreign_key => "transaction_record_id"
validates_associated :transaction_record, :class_name => 'Transaction::Record', :foreign_key => "transaction_record_id"
#validates_presence_of :content, :message => 'Deve Informar Um arquivo Xml'
#has_attached_file :xml

Expand Down

0 comments on commit 66c8d8e

Please sign in to comment.