Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin is mySQL only. Not working at our university (postgress) #7

Open
RainerRutka opened this issue Jan 16, 2014 · 1 comment
Open

Comments

@RainerRutka
Copy link

Unfortunately the plugin is for mySQL only. But, we have Postgress installed.

See the errsor-message:
ActiveRecord::StatementInvalid (PG::SyntaxError: FEHLER: Syntaxfehler bei »« LINE 1: INSERT INTOwatchers(user_id,watchable_id,watchabl...
^
: INSERT INTO watchers (user_id, watchable_id, watchable_type) VALUES (564, 3385, 'Issue')):
activerecord (3.2.16) lib/active_record/connection_adapters/postgresql_adapter.rb:650:in exec' activerecord (3.2.16) lib/active_record/connection_adapters/postgresql_adapter.rb:650:inblock in execute'
activerecord (3.2.16) lib/active_record/connection_adapters/abstract_adapter.rb:280:in block in log' activesupport (3.2.16) lib/active_support/notifications/instrumenter.rb:20:ininstrument'
activerecord (3.2.16) lib/active_record/connection_adapters/abstract_adapter.rb:275:in log' activerecord (3.2.16) lib/active_record/connection_adapters/postgresql_adapter.rb:649:inexecute'
plugins/redmine_watcher_groups/app/controllers/watcher_groups_controller.rb:18:in block in create' plugins/redmine_watcher_groups/app/controllers/watcher_groups_controller.rb:13:ineach'
plugins/redmine_watcher_groups/app/controllers/watcher_groups_controller.rb:13:in create' actionpack (3.2.16) lib/action_controller/metal/implicit_render.rb:4:insend_action'

Any suggestions to fix this :-) ?

@mmackiew
Copy link

I solve this problem in controller:

Watcher.connection.execute("INSERT INTO #{Watcher.table_name} (user_id, watchable_id, watchable_type) VALUES (#{group_id}, #{@watched.id}, '#{@watched.class.name}')")

U should remove ugly mySQL quote and after that it works fine with PostgreSQL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants