mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-13 10:54:23 +01:00
Changed code to support basic i18n.
Added RubyMine configuration and rvm setup to .gitignore.
This commit is contained in:
parent
04faa5d408
commit
fd3f69d927
99 changed files with 1157 additions and 601 deletions
|
|
@ -13,7 +13,7 @@ class User < ActiveRecord::Base
|
|||
def update_positions(context_ids)
|
||||
context_ids.each_with_index do |id, position|
|
||||
context = self.detect { |c| c.id == id.to_i }
|
||||
raise "Context id #{id} not associated with user id #{@user.id}." if context.nil?
|
||||
raise I18n.t('models.user.error_context_not_associated', :context => id, :user => @user.id) if context.nil?
|
||||
context.update_attribute(:position, position + 1)
|
||||
end
|
||||
end
|
||||
|
|
@ -27,7 +27,7 @@ class User < ActiveRecord::Base
|
|||
def update_positions(project_ids)
|
||||
project_ids.each_with_index do |id, position|
|
||||
project = self.detect { |p| p.id == id.to_i }
|
||||
raise "Project id #{id} not associated with user id #{@user.id}." if project.nil?
|
||||
raise I18n.t('models.user.error_project_not_associated', :project => id, :user => @user.id) if project.nil?
|
||||
project.update_attribute(:position, position + 1)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue