Open spinne1000 opened 9 years ago
Hi,
First comment the observer line into the file redmine/plugins/systango_hrm/init.rb on line number 13 comment this line
because it is not necessary to load in to rails4
and second things to change the line number 21, code in to the file redmine/plugins/systango_hrm/lib/systango_hrm/user_patch.rb
remove -> has_many :self_employee_leaves, :class_name => "SystangoHrmEmployeeLeave", :foreign_key => 'user_id',:conditions => {:referral_id =>nil}, dependent: :destroy
to replace this one
has_many :self_employee_leaves, -> { where(:referral_id =>nil) }, :class_name => "SystangoHrmEmployeeLeave", :foreign_key => 'user_id', dependent: :destroy
That helped, thanks (3.1)
Hello, I get an install error on Redmine 3.0.3:
root@vmd8303:/opt/redmine/redmine-3.0.3# rake redmine:plugins NAME=systango_hrm RAILS_ENV=production --trace * Invoke redmine:plugins (first_time) * Execute redmine:plugins * Invoke redmine:plugins:migrate (first_time) * Invoke environment (first_time) \ Execute environment
rake aborted! NoMethodError: undefined method'
Tasks: TOP => redmine:plugins:migrate => environment
observers' for ActiveRecord::Base:Class /var/lib/gems/2.1.0/gems/activerecord-4.2.1/lib/active_record/dynamic_matchers.rb:26:in
method_missing' /opt/redmine/redmine-3.0.3/plugins/systango_hrm/init.rb:13:inblock in <top (required)>' /opt/redmine/redmine-3.0.3/lib/redmine/plugin.rb:75:in
instance_eval' /opt/redmine/redmine-3.0.3/lib/redmine/plugin.rb:75:inregister' /opt/redmine/redmine-3.0.3/plugins/systango_hrm/init.rb:6:in
<top (required)>' /var/lib/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:inrequire' /var/lib/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in
block in require' /var/lib/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:inload_dependency' /var/lib/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in
require' /opt/redmine/redmine-3.0.3/lib/redmine/plugin.rb:155:inblock in load' /opt/redmine/redmine-3.0.3/lib/redmine/plugin.rb:146:in
each' /opt/redmine/redmine-3.0.3/lib/redmine/plugin.rb:146:inload' /opt/redmine/redmine-3.0.3/config/initializers/30-redmine.rb:21:in
<top (required)>' /var/lib/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:inload' /var/lib/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in
block in load' /var/lib/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:inload_dependency' /var/lib/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in
load' /var/lib/gems/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:652:inblock in load_config_initializer' /var/lib/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/notifications.rb:166:in
instrument' /var/lib/gems/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:651:inload_config_initializer' /var/lib/gems/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:616:in
block (2 levels) in class:Engine' /var/lib/gems/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:615:ineach' /var/lib/gems/2.1.0/gems/railties-4.2.1/lib/rails/engine.rb:615:in
block in class:Engine' /var/lib/gems/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:ininstance_exec' /var/lib/gems/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in
run' /var/lib/gems/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:55:inblock in run_initializers' /usr/lib/ruby/2.1.0/tsort.rb:226:in
block in tsort_each' /usr/lib/ruby/2.1.0/tsort.rb:348:inblock (2 levels) in each_strongly_connected_component' /usr/lib/ruby/2.1.0/tsort.rb:418:in
block (2 levels) in each_strongly_connected_component_from' /usr/lib/ruby/2.1.0/tsort.rb:427:ineach_strongly_connected_component_from' /usr/lib/ruby/2.1.0/tsort.rb:417:in
block in each_strongly_connected_component_from' /var/lib/gems/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:44:ineach' /var/lib/gems/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:44:in
tsort_each_child' /usr/lib/ruby/2.1.0/tsort.rb:411:incall' /usr/lib/ruby/2.1.0/tsort.rb:411:in
each_strongly_connected_component_from' /usr/lib/ruby/2.1.0/tsort.rb:347:inblock in each_strongly_connected_component' /usr/lib/ruby/2.1.0/tsort.rb:345:in
each' /usr/lib/ruby/2.1.0/tsort.rb:345:incall' /usr/lib/ruby/2.1.0/tsort.rb:345:in
each_strongly_connected_component' /usr/lib/ruby/2.1.0/tsort.rb:224:intsort_each' /usr/lib/ruby/2.1.0/tsort.rb:205:in
tsort_each' /var/lib/gems/2.1.0/gems/railties-4.2.1/lib/rails/initializable.rb:54:inrun_initializers' /var/lib/gems/2.1.0/gems/railties-4.2.1/lib/rails/application.rb:352:in
initialize!' /opt/redmine/redmine-3.0.3/config/environment.rb:14:in<top (required)>' /var/lib/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in
require' /var/lib/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:inblock in require' /var/lib/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in
load_dependency' /var/lib/gems/2.1.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:inrequire' /var/lib/gems/2.1.0/gems/railties-4.2.1/lib/rails/application.rb:328:in
require_environment!' /var/lib/gems/2.1.0/gems/railties-4.2.1/lib/rails/application.rb:457:inblock in run_tasks_blocks' /var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in
call' /var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:inblock in execute' /var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in
each' /var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:inexecute' /var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:179:in
block in invoke_with_call_chain' /usr/lib/ruby/2.1.0/monitor.rb:211:inmon_synchronize' /var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:172:in
invoke_with_call_chain' /var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:201:inblock in invoke_prerequisites' /var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:199:in
each' /var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:199:ininvoke_prerequisites' /var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:178:in
block in invoke_with_call_chain' /usr/lib/ruby/2.1.0/monitor.rb:211:inmon_synchronize' /var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:172:in
invoke_with_call_chain' /var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:165:ininvoke' /opt/redmine/redmine-3.0.3/lib/tasks/redmine.rake:52:in
block (2 levels) in <top (required)>' /var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:incall' /var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in
block in execute' /var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:ineach' /var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in
execute' /var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:179:inblock in invoke_with_call_chain' /usr/lib/ruby/2.1.0/monitor.rb:211:in
mon_synchronize' /var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:172:ininvoke_with_call_chain' /var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:165:in
invoke' /var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:150:ininvoke_task' /var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in
block (2 levels) in top_level' /var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:ineach' /var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in
block in top_level' /var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:115:inrun_with_threads' /var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:100:in
top_level' /var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:78:inblock in run' /var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:176:in
standard_exception_handling' /var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:75:inrun' /var/lib/gems/2.1.0/gems/rake-10.4.2/bin/rake:33:in
<top (required)>' /usr/local/bin/rake:23:inload' /usr/local/bin/rake:23:in
Are observers still in Ruby?