Skip to content

Commit 6ec2601

Browse files
committed
updated for Rails 4+ compatibility
1 parent 9b38e31 commit 6ec2601

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

app/controllers/timesheet_controller.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ class TimesheetController < ApplicationController
33

44
layout 'base'
55
if Rails::VERSION::MAJOR < 5 # < Rails 5
6-
before_filter :get_list_size
7-
before_filter :get_precision
8-
before_filter :get_activities
6+
before_action :get_list_size
7+
before_action :get_precision
8+
before_action :get_activities
99
else # >= Rails 5
1010
before_action :get_list_size
1111
before_action :get_precision
@@ -37,7 +37,7 @@ def index
3737

3838
def report
3939
if params && params[:timesheet]
40-
@timesheet = Timesheet.new(params[:timesheet])
40+
@timesheet = Timesheet.new(params.require(:timesheet).permit!)
4141
else
4242
redirect_to :action => 'index'
4343
return

db/migrate/002_create_enum_prices.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class CreateEnumPrices < ActiveRecord::Migration
1+
class CreateEnumPrices < ActiveRecord::Migration[4.2]
22
def change
33
create_table :prices do |t|
44
t.references :enumerations

0 commit comments

Comments
 (0)