update gems and fix i18n and aasm deprecation warnings

This commit is contained in:
Reinier Balt 2013-12-30 20:52:35 +01:00
parent b1c306b09e
commit 17dca39d3a
10 changed files with 113 additions and 104 deletions

View file

@ -89,7 +89,7 @@ class Project < ActiveRecord::Base
# as a result of acts_as_state_machine calling state=() to update the attribute
def transition_to(candidate_state)
case candidate_state.to_sym
when aasm_current_state
when aasm.current_state
return
when :hidden
hide!

View file

@ -66,7 +66,7 @@ class Todo < ActiveRecord::Base
# state machine
include AASM
aasm_initial_state Proc.new { |t| (t.show_from && t.user && (t.show_from > t.user.date)) ? :deferred : :active}
aasm_initial_state = Proc.new { |t| (t.show_from && t.user && (t.show_from > t.user.date)) ? :deferred : :active}
aasm :column => :state do

View file

@ -28,4 +28,4 @@
<% else -%><%= render :partial => "notes/notes_summary", :collection => @project.notes %>
<% end -%>
<h2><%= t('projects.settings') %></h2>
<%= t('projects.state', :state => project.aasm_current_state.to_s) %>. <%= @project_default_context %>
<%= t('projects.state', :state => project.aasm.current_state.to_s) %>. <%= @project_default_context %>

View file

@ -1,11 +1,11 @@
# TODO: is this dead code?
page.select('#project_status .active span').each do |element|
element.className = @project.aasm_current_state == :active ? 'active_state' : 'inactive_state'
element.className = @project.aasm.current_state == :active ? 'active_state' : 'inactive_state'
end
page.select('#project_status .hidden span').each do |element|
element.className = @project.aasm_current_state == :hidden ? 'active_state' : 'inactive_state'
element.className = @project.aasm.current_state == :hidden ? 'active_state' : 'inactive_state'
end
page.select('#project_status .completed span').each do |element|
element.className = @project.aasm_current_state == :completed ? 'active_state' : 'inactive_state'
element.className = @project.aasm.current_state == :completed ? 'active_state' : 'inactive_state'
end
page.notify :notice, "Set project status to #{@project.aasm_current_state}", 5.0
page.notify :notice, "Set project status to #{@project.aasm.current_state}", 5.0