Merge pull request #79 from finnlabs/feature/20043-rails-4.1

[20043] Upgrade to Rails 4.1.x
pull/6827/head
ulferts 9 years ago
commit 538532725a
  1. 4
      app/controllers/meetings_controller.rb
  2. 1
      app/models/meeting.rb
  3. 2
      openproject-meeting.gemspec
  4. 4
      spec/controllers/meetings_controller_spec.rb

@ -133,7 +133,9 @@ class MeetingsController < ApplicationController
end end
def find_meeting def find_meeting
@meeting = Meeting.find(params[:id], include: [:project, :author, { participants: :user }, :agenda, :minutes]) @meeting = Meeting
.includes([:project, :author, { participants: :user }, :agenda, :minutes])
.find(params[:id])
@project = @meeting.project @project = @meeting.project
rescue ActiveRecord::RecordNotFound rescue ActiveRecord::RecordNotFound
render_404 render_404

@ -43,6 +43,7 @@ class Meeting < ActiveRecord::Base
acts_as_searchable columns: ["#{table_name}.title", "#{MeetingContent.table_name}.text"], acts_as_searchable columns: ["#{table_name}.title", "#{MeetingContent.table_name}.text"],
include: [:contents, :project], include: [:contents, :project],
references: :meeting_contents,
date_column: "#{table_name}.created_at" date_column: "#{table_name}.created_at"
acts_as_journalized acts_as_journalized

@ -22,7 +22,7 @@ Gem::Specification.new do |s|
s.files = Dir['{app,config,db,lib,doc}/**/*', 'README.md'] s.files = Dir['{app,config,db,lib,doc}/**/*', 'README.md']
s.test_files = Dir['spec/**/*'] s.test_files = Dir['spec/**/*']
s.add_dependency 'rails', '~> 4.0.13' s.add_dependency 'rails', '~> 4.1.11'
s.add_development_dependency 'factory_girl_rails', '~> 4.0' s.add_development_dependency 'factory_girl_rails', '~> 4.0'
end end

@ -52,7 +52,7 @@ describe MeetingsController, type: :controller do
describe 'show' do describe 'show' do
before(:each) do before(:each) do
@m = mock_model(Meeting) @m = mock_model(Meeting)
allow(Meeting).to receive(:find).and_return(@m) allow(Meeting).to receive_message_chain(:includes, :find).and_return(@m)
allow(@m).to receive(:project).and_return(@p) allow(@m).to receive(:project).and_return(@p)
allow(allow(@m).to receive(:agenda)).to receive(:present?).and_return(false) allow(allow(@m).to receive(:agenda)).to receive(:present?).and_return(false)
end end
@ -84,7 +84,7 @@ describe MeetingsController, type: :controller do
describe 'edit' do describe 'edit' do
before(:each) do before(:each) do
@m = mock_model(Meeting) @m = mock_model(Meeting)
allow(Meeting).to receive(:find).and_return(@m) allow(Meeting).to receive_message_chain(:includes, :find).and_return(@m)
allow(@m).to receive(:project).and_return(@p) allow(@m).to receive(:project).and_return(@p)
end end
describe 'html' do describe 'html' do

Loading…
Cancel
Save