diff options
author | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2017-03-01 22:55:23 +0100 |
---|---|---|
committer | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2017-03-01 22:55:23 +0100 |
commit | afc25fbc7d02a6f2bf40e4c0673cdc61fc0d96ec (patch) | |
tree | 9dfa79f976ad4cb4df10ed0770251c915638acf4 | |
parent | 2eb9ae7abd49aa03a19a97508d3ee5246bcd40e2 (diff) | |
download | ecs-afc25fbc7d02a6f2bf40e4c0673cdc61fc0d96ec.tar.gz ecs-afc25fbc7d02a6f2bf40e4c0673cdc61fc0d96ec.zip |
Strip spaces.
-rw-r--r-- | app/models/auth.rb | 6 | ||||
-rw-r--r-- | app/models/community_message.rb | 8 | ||||
-rw-r--r-- | app/models/ev_type.rb | 10 | ||||
-rw-r--r-- | app/models/identity.rb | 10 | ||||
-rw-r--r-- | app/models/membership_message.rb | 20 |
5 files changed, 27 insertions, 27 deletions
diff --git a/app/models/auth.rb b/app/models/auth.rb index 11f0332..14f2831 100644 --- a/app/models/auth.rb +++ b/app/models/auth.rb @@ -1,5 +1,5 @@ class Auth < ActiveRecord::Base - belongs_to :message + belongs_to :message #scope :hash, lambda {|hash| { # :joins => {:membership_messages => {:membership => :participant}}, @@ -10,8 +10,8 @@ class Auth < ActiveRecord::Base # if valid time window return true def test_validation_window b = JSON.parse(message.body) - sov = Time.parse(b["sov"]) - eov = Time.parse(b["eov"]) + sov = Time.parse(b["sov"]) + eov = Time.parse(b["eov"]) if eov > Time.now true else diff --git a/app/models/community_message.rb b/app/models/community_message.rb index b0e6033..1f7b1f3 100644 --- a/app/models/community_message.rb +++ b/app/models/community_message.rb @@ -1,17 +1,17 @@ # Copyright (C) 2007, 2008, 2009, 2010 Heiko Bernloehr (FreeIT.de). -# +# # This file is part of ECS. -# +# # ECS is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. -# +# # ECS is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Affero General Public License for more details. -# +# # You should have received a copy of the GNU Affero General Public # License along with ECS. If not, see <http://www.gnu.org/licenses/>. diff --git a/app/models/ev_type.rb b/app/models/ev_type.rb index 87c87ba..f701793 100644 --- a/app/models/ev_type.rb +++ b/app/models/ev_type.rb @@ -1,21 +1,21 @@ # Copyright (C) 2007, 2008, 2009, 2010 Heiko Bernloehr (FreeIT.de). -# +# # This file is part of ECS. -# +# # ECS is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. -# +# # ECS is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Affero General Public License for more details. -# +# # You should have received a copy of the GNU Affero General Public # License along with ECS. If not, see <http://www.gnu.org/licenses/>. class EvType < ActiveRecord::Base - has_many :events + has_many :events end diff --git a/app/models/identity.rb b/app/models/identity.rb index f6f3cb7..b8b0e91 100644 --- a/app/models/identity.rb +++ b/app/models/identity.rb @@ -1,17 +1,17 @@ # Copyright (C) 2007, 2008, 2009, 2010 Heiko Bernloehr (FreeIT.de). -# +# # This file is part of ECS. -# +# # ECS is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. -# +# # ECS is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Affero General Public License for more details. -# +# # You should have received a copy of the GNU Affero General Public # License along with ECS. If not, see <http://www.gnu.org/licenses/>. @@ -23,7 +23,7 @@ class Identity < ActiveRecord::Base belongs_to :participant # TODO validate :participant_id - # it's possible in rails 2.3.6 with :inverse_of + # it's possible in rails 2.3.6 with :inverse_of validates_presence_of :name validates_uniqueness_of :name diff --git a/app/models/membership_message.rb b/app/models/membership_message.rb index e196902..b62da0a 100644 --- a/app/models/membership_message.rb +++ b/app/models/membership_message.rb @@ -1,17 +1,17 @@ # Copyright (C) 2007, 2008, 2009, 2010 Heiko Bernloehr (FreeIT.de). -# +# # This file is part of ECS. -# +# # ECS is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. -# +# # ECS is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Affero General Public License for more details. -# +# # You should have received a copy of the GNU Affero General Public # License along with ECS. If not, see <http://www.gnu.org/licenses/>. @@ -25,13 +25,13 @@ class MembershipMessage < ActiveRecord::Base rec_mids = extract_x_ecs_receiver_memberships(x_ecs_receiver_memberships) rec_cids = extract_x_ecs_receiver_communities(x_ecs_receiver_communities) if rec_cids.blank? and rec_mids.blank? - raise Ecs::MissingReceiverHeaderException, + raise Ecs::MissingReceiverHeaderException, "You must at least specify one of X-EcsReceiverMemberships or X-EcsReceiverCommunities header\r\n" end pop_succ = false memberships_for_sender_participant_id = Membership.for_participant_id(sender_participant.id) - + rec_mids.each do |rmid| # Test if sender joins same community as receiver if memberships_for_sender_participant_id.map{|m| m.community.id}.include?(Membership.find(rmid).community.id) @@ -53,7 +53,7 @@ class MembershipMessage < ActiveRecord::Base pop_succ = true end end - + unless pop_succ raise Ecs::AuthorizationException, "You are not joining at least one of the community to which you are addressing.\r\n" + @@ -61,7 +61,7 @@ class MembershipMessage < ActiveRecord::Base "You are not joining at least one of the same community as the receiving membership.\r\n" end rescue ActiveRecord::RecordNotFound - raise Ecs::InvalidMessageException, + raise Ecs::InvalidMessageException, "Membership id in X-EcsReceiverMemberships header not found." end @@ -81,7 +81,7 @@ class MembershipMessage < ActiveRecord::Base else # comm_str should be a community name comm= Community.find_by_name(comm_str) - if comm == nil then + if comm == nil then raise Ecs::InvalidMessageException, "community id/name in X-EcsReceiverCommunities header not found: #{comm_str}" end receiver_communities << comm.id @@ -90,7 +90,7 @@ class MembershipMessage < ActiveRecord::Base receiver_communities.uniq! receiver_communities end - + def self.extract_x_ecs_receiver_memberships(erm) receiver_memberships= [] erm.split(',').map {|e| e.strip}.each do |memb_str| |