fixes hound

This commit is contained in:
zmagod 2017-06-28 15:29:10 +02:00
parent 525c9770ac
commit d8a3fdea20
3 changed files with 7 additions and 12 deletions

View file

@ -374,7 +374,7 @@ class MyModule < ApplicationRecord
x: self.x,
y: self.y)
clone.save
# Remove the automatically generated protocol,
# & clone the protocol instead
clone.protocol.destroy

View file

@ -11,13 +11,9 @@ class SampleMyModule < ApplicationRecord
foreign_key: 'assigned_by_id',
class_name: 'User',
optional: true
belongs_to :sample,
inverse_of: :sample_my_modules,
optional: true
belongs_to :my_module,
inverse_of: :sample_my_modules,
optional: true
belongs_to :sample, inverse_of: :sample_my_modules, optional: true
belongs_to :my_module, inverse_of: :sample_my_modules, optional: true
def increment_nr_of_module_samples
my_module.increment!(:nr_of_assigned_samples)
sample.increment!(:nr_of_modules_assigned_to)

View file

@ -1,11 +1,10 @@
class Token < ApplicationRecord
validates :token, presence: true
validates :ttl, presence: true
validates :token, presence: true
validates :ttl, presence: true
belongs_to :user,
belongs_to :user,
foreign_key: 'user_id',
class_name: 'User',
inverse_of: :tokens,
optional: true
end