app/models/bit_player/navigator.rb in bit_player-0.1.4 vs app/models/bit_player/navigator.rb in bit_player-0.2.0

- old
+ new

@@ -56,11 +56,11 @@ @status.initialize_context(context) end def initialize_location(options) content_module = ContentModule.find(options[:module_id]) - @status.context = content_module.context + @status.context = content_module.tool.title @status.module_position = content_module.position @status.provider_position = 1 if options[:provider_id] @status.provider_position = content_module.content_providers .find(options[:provider_id]).position @@ -70,11 +70,14 @@ end def current_module @current_module ||= nil - module_attrs = { context: context, position: module_position } + module_attrs = { + bit_player_tool_id: Tool.find_by_title(context).try(:id), + position: module_position + } if current_module_stale? @current_module = ContentModule.where(module_attrs).first end @@ -83,10 +86,10 @@ private def current_module_stale? @current_module.nil? || - (@current_module.context != context || + (@current_module.tool.try(:title) != context || @current_module.position != module_position) end end end