mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-06 05:04:35 +08:00
fixes hound
This commit is contained in:
parent
525c9770ac
commit
d8a3fdea20
3 changed files with 7 additions and 12 deletions
|
@ -374,7 +374,7 @@ class MyModule < ApplicationRecord
|
||||||
x: self.x,
|
x: self.x,
|
||||||
y: self.y)
|
y: self.y)
|
||||||
clone.save
|
clone.save
|
||||||
|
|
||||||
# Remove the automatically generated protocol,
|
# Remove the automatically generated protocol,
|
||||||
# & clone the protocol instead
|
# & clone the protocol instead
|
||||||
clone.protocol.destroy
|
clone.protocol.destroy
|
||||||
|
|
|
@ -11,13 +11,9 @@ class SampleMyModule < ApplicationRecord
|
||||||
foreign_key: 'assigned_by_id',
|
foreign_key: 'assigned_by_id',
|
||||||
class_name: 'User',
|
class_name: 'User',
|
||||||
optional: true
|
optional: true
|
||||||
belongs_to :sample,
|
belongs_to :sample, inverse_of: :sample_my_modules, optional: true
|
||||||
inverse_of: :sample_my_modules,
|
belongs_to :my_module, inverse_of: :sample_my_modules, optional: true
|
||||||
optional: true
|
|
||||||
belongs_to :my_module,
|
|
||||||
inverse_of: :sample_my_modules,
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
def increment_nr_of_module_samples
|
def increment_nr_of_module_samples
|
||||||
my_module.increment!(:nr_of_assigned_samples)
|
my_module.increment!(:nr_of_assigned_samples)
|
||||||
sample.increment!(:nr_of_modules_assigned_to)
|
sample.increment!(:nr_of_modules_assigned_to)
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
class Token < ApplicationRecord
|
class Token < ApplicationRecord
|
||||||
validates :token, presence: true
|
validates :token, presence: true
|
||||||
validates :ttl, presence: true
|
validates :ttl, presence: true
|
||||||
|
|
||||||
belongs_to :user,
|
belongs_to :user,
|
||||||
foreign_key: 'user_id',
|
foreign_key: 'user_id',
|
||||||
class_name: 'User',
|
class_name: 'User',
|
||||||
inverse_of: :tokens,
|
inverse_of: :tokens,
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue