giemsky / redmine_carousel

17 stars 9 forks source link

Undefined method 'carousels' #18

Closed AlDemion closed 12 years ago

AlDemion commented 12 years ago

Hi. When i enable carousel module i got error 500

Log here

ActionView::TemplateError (undefined method `carousels' for #Project:0x7fe5461c2a18) on line #1 of vendor/plugins/redmine_carousel/app/views/carousels/_index.html.erb: 1: <% if @project.carousels.empty? %> 2:

<%= l(:label_no_data) %>

3: <% else %> 4:

Details about my configuration here

About your application's environment Ruby version 1.8.7 (x86_64-linux) RubyGems version 1.7.2 Rack version 1.3 Rails version 2.3.14 Active Record version 2.3.14 Active Resource version 2.3.14 Action Mailer version 2.3.14 Active Support version 2.3.14 Edge Rails revision unknown Application root /usr/share/redmine Environment production Database adapter mysql Database schema version 20120216120038

About your Redmine plugins Redmine Process Frameworks plugin 0.0.1 Tab Plugin 0.3.1 Screenshot Paste 1.1.1 Redmine Hudson plugin 1.0.7 Redmine Theme Changer plugin 0.0.5 Redmine Local Avatars plugin 0.1.0 Redmine Auto Done 100% 0.0.1 Redmine Tracker Control plugin 1.0.1 Redmine Sql Reports plugin 0.3.2 Redmine Close Button plugin 0.0.7 Redmine Better Gantt Chart plugin 0.6.1 Redmine Issue Checklist plugin 1.0.0 Redmine Graph Activities plugin 0.0.2 Redmine Carousel plugin 1.2.0 Redmine Advanced Issues plugin 0.0.4 Redmine Repository plugin 0.0.2 Redmine Bookmarks plugin 1.0.1 Redmine - Ldap Sync 1.1.0 Redmine Default Version plugin 0.0.1 Issues XLS export 0.1.3 Redmine Light Box plugin 0.0.1 Issue Importer 1.0 Redmine Dnoise Workload plugin 0.0.1 Redmine Commit Relation Editor plugin 0.0.4 DMSF 1.2.2 Redcase 1.0 alpha 0.149 Extended fields 0.1.0 Redmine Code Review plugin 0.4.6

AlDemion commented 12 years ago

Ok. I solved a problem by changing content of lib/project_patch.rb to

module RedmineDefaultVersion module Patches module ProjectPatch def self.included(base) # :nodoc:

Same as typing in the class

    base.class_eval do
      unloadable # Send unloadable so it will not be unloaded in development
      belongs_to :default_version, :class_name => 'Version', :foreign_key => 'default_version_id'
      has_many :carousels, :dependent => :destroy
    end
  end
end

end end