aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXinhui2017-11-14 11:39:28 +0100
committerXinhui2017-11-14 12:12:41 +0100
commitcc785a55c485a3a69f917c183c00db18a9de6614 (patch)
treee73ee61830600ae2d35c506e0a758a79d6b7c8c2
parent9866abc0353908e059080d139d63e3e91fefe65d (diff)
downloadchouette-core-cc785a55c485a3a69f917c183c00db18a9de6614.tar.bz2
Remove rule parameter set route
Refs #4516 Removel rule parameter set from migration
-rw-r--r--config/routes.rb1
-rw-r--r--db/migrate/20150218175300_set_organisation_id_to_rps.rb7
-rw-r--r--db/migrate/20150219175300_insert_default_organisation.rb6
3 files changed, 4 insertions, 10 deletions
diff --git a/config/routes.rb b/config/routes.rb
index 0470d9aec..e5b55524d 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -68,7 +68,6 @@ ChouetteIhm::Application.routes.draw do
resource :organisation, :only => [:show, :edit, :update] do
resources :users
- resources :rule_parameter_sets
end
resources :api_keys, :only => [:edit, :update, :new, :create, :destroy]
diff --git a/db/migrate/20150218175300_set_organisation_id_to_rps.rb b/db/migrate/20150218175300_set_organisation_id_to_rps.rb
index 024f5938e..77ac1a71c 100644
--- a/db/migrate/20150218175300_set_organisation_id_to_rps.rb
+++ b/db/migrate/20150218175300_set_organisation_id_to_rps.rb
@@ -1,13 +1,12 @@
class SetOrganisationIdToRps < ActiveRecord::Migration
def up
- RuleParameterSet.where(organisation_id: nil).update_all "name = concat(name, ' ', id)"
-
+ # RuleParameterSet.where(organisation_id: nil).update_all "name = concat(name, ' ', id)"
# RuleParameterSet.joins(...).update_all("organisation_id = referentials.organisation_id")
# fails (see https://github.com/rails/arel/pull/294)
- execute "UPDATE rule_parameter_sets SET organisation_id = referentials.organisation_id FROM referentials WHERE referentials.id = rule_parameter_sets.referential_id;"
+ # execute "UPDATE rule_parameter_sets SET organisation_id = referentials.organisation_id FROM referentials WHERE referentials.id = rule_parameter_sets.referential_id;"
end
def down
- RuleParameterSet.update_all organisation_id: nil
+ # RuleParameterSet.update_all organisation_id: nil
end
end
diff --git a/db/migrate/20150219175300_insert_default_organisation.rb b/db/migrate/20150219175300_insert_default_organisation.rb
index c8e97b562..fe7bbd539 100644
--- a/db/migrate/20150219175300_insert_default_organisation.rb
+++ b/db/migrate/20150219175300_insert_default_organisation.rb
@@ -4,7 +4,7 @@ class InsertDefaultOrganisation < ActiveRecord::Migration
has_many :rule_parameter_sets, :dependent => :destroy
end
-
+
def up
organisation = Organisation.find_or_create_by!(:name => "Chouette")
Referential.where( :organisation_id => nil).each do |r|
@@ -13,10 +13,6 @@ class InsertDefaultOrganisation < ActiveRecord::Migration
User.where( :organisation_id => nil).each do |r|
r.update_attributes :organisation_id => organisation.id
end
- Organisation.all.each do |organisation|
- RuleParameterSet.default_for_all_modes( organisation).save if organisation.rule_parameter_sets.empty?
- end
-
end
def down