SkyWriter/toggl

Redmine 2.2.3.stable.11530 - fix to 002_create_api_key_field.rb:

Closed this issue · 3 comments

Hi!

When I try install your plugin, I was find small error.
After when you will try RAILS_ENV=production ... you could see this error.

002_create_api_key_field.rb:5: syntax error, unexpected ':', expecting ']'

The solution to resolve them :

002_create_api_key_field.rb
class CreateApiKeyField < ActiveRecord::Migration

def up
custom_field = CustomField.new_subclass_instance('UserCustomField', {
:name => 'Toggl API Key',
:field_format => 'string',
:min_length => 32,
:max_length => 32,
:regexp => '',
:default_value => '',
:is_required => 0,
:visible => 1,
:editable => 1,
:is_filter => 0
})
custom_field.save!
end

def down
CustomField.find_by_name('Toggl API Key').destroy
end

end

It's Ruby 1.8.7, isn't it?

Whatever. Fixed new style hashes to be compatible. You might need to do git pull origin master to get the update.

I can see no reason to use Ruby 1.8 though, as newer versions are so much faster and way much less memory hungry.

I think plugin should be compatible with rubby 1.8.7. Probably many people still using older version redmine. By the way older redmine has more plugins than new one.
Thank you :-)