diff --git a/Gemfile.lock b/Gemfile.lock index ac1fb869..420d918d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -210,7 +210,7 @@ GEM activerecord kaminari-core (= 1.0.1) kaminari-core (1.0.1) - kramdown (1.14.0) + kramdown (1.15.0) libv8 (3.16.14.19) listen (3.1.5) rb-fsevent (~> 0.9, >= 0.9.4) @@ -301,7 +301,7 @@ GEM thor (>= 0.18.1, < 2.0) rainbow (2.2.2) rake - rake (12.0.0) + rake (12.1.0) ransack (1.8.3) actionpack (>= 3.0) activerecord (>= 3.0) @@ -317,14 +317,14 @@ GEM responders (2.4.0) actionpack (>= 4.2.0, < 5.3) railties (>= 4.2.0, < 5.3) - rubocop (0.49.1) + rubocop (0.50.0) parallel (~> 1.10) parser (>= 2.3.3.1, < 3.0) powerpack (~> 0.1) - rainbow (>= 1.99.1, < 3.0) + rainbow (>= 2.2.2, < 3.0) ruby-progressbar (~> 1.7) unicode-display_width (~> 1.0, >= 1.0.1) - ruby-progressbar (1.8.1) + ruby-progressbar (1.8.3) ruby_dep (1.5.0) ruby_parser (3.10.1) sexp_processor (~> 4.9) @@ -347,7 +347,7 @@ GEM simple_calendar (2.2.7) rails (>= 3.0) simple_oauth (0.3.1) - simplecov (0.15.0) + simplecov (0.15.1) docile (~> 1.1.0) json (>= 1.8, < 3) simplecov-html (~> 0.10.0) diff --git a/app/models/city.rb b/app/models/city.rb index 9bf0cd0c..f21e95f3 100644 --- a/app/models/city.rb +++ b/app/models/city.rb @@ -3,6 +3,4 @@ # It is mainly used to manage coordinates # class City < ApplicationRecord - has_many :events, foreign_key: :city, primary_key: :name - has_many :orgas, foreign_key: :city, primary_key: :name end diff --git a/app/models/kind.rb b/app/models/kind.rb index 79a7d575..10e7a9e0 100644 --- a/app/models/kind.rb +++ b/app/models/kind.rb @@ -1,4 +1,4 @@ # Gives the possibility to organise organisations! :) class Kind < ApplicationRecord - has_many :orgas + has_many :orgas, dependent: :destroy end diff --git a/app/models/region.rb b/app/models/region.rb index ef6fa540..1c229c64 100644 --- a/app/models/region.rb +++ b/app/models/region.rb @@ -1,9 +1,9 @@ # This is mostly to group events around a region class Region < ApplicationRecord belongs_to :region - has_many :regions + has_many :regions, dependent: :nullify - has_many :orgas + has_many :orgas, dependent: :destroy default_scope { order :name } diff --git a/app/models/user.rb b/app/models/user.rb index 39cbcf29..41fd48db 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -8,8 +8,6 @@ class User < ApplicationRecord devise :database_authenticatable, authentication_keys: [:login] # :registerable, :validatable - has_many :notes - validates :login, presence: true def encrypted_password=(pass) diff --git a/db/seeds.rb b/db/seeds.rb index 73d3a6cf..6e6bced5 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,5 +1,3 @@ -# encoding: utf-8 - # This file should contain all the record creation needed to seed the database # with its default values. # The data can then be loaded with the rake db:seed (or created alongside the