diff --git a/lib/marley/joints/forum.rb b/lib/marley/joints/forum.rb index ce12f44..21f2061 100644 --- a/lib/marley/joints/forum.rb +++ b/lib/marley/joints/forum.rb @@ -15,8 +15,8 @@ def topics(params=nil) end filters.inject(self.roots) {|ds,f| ds.filter(f)} end - def list(params=nil) - topics(params).eager_graph(:user).all.map{|t| t.thread} + def list(params={}) + reggae_instance_list(params) end def reggae_instance_list(params={}) t=topics(params).all @@ -53,7 +53,7 @@ def section_nav self.reggae_link(:new, 'New Post'), self.reggae_link(:list, 'All Posts'), self.reggae_link(:recent_topics, 'Recent Topics'), - Marley::ReggaeSection.new({:title => 'Topics Tagged With:', :navigation => MR::Tag.filter(:id => topics.join(:messages_tags).where(:messages__id => :message_id).select(:tag_id)).map{|t| reggae_link('list',t.tag,"#{resource_name}[tags]=#{t.tag}")}}) + Marley::ReggaeSection.new({:title => 'Public Tags', :navigation => MR::PublicTag.filter(:id => topics.all.map{|t|}).map{|t| reggae_link('list',t.tag,"#{resource_name}[_public_tags]=#{t.tag}")}}) ] end def recent_topics diff --git a/lib/marley/joints/tags.rb b/lib/marley/joints/tags.rb index bcaa72b..ca003ec 100644 --- a/lib/marley/joints/tags.rb +++ b/lib/marley/joints/tags.rb @@ -40,7 +40,7 @@ def initialize(opts={}) super send("#{tags_meth}_dataset").filter({:tags__user_id => (tag_class.associations.include?(:user) ? self.class.current_user[:id] : nil)}).each {|tag| send("remove#{tag_col_name}".singularize,tag)} vals_hash={:user_id => (tag_class.associations.include?(:user) ? self.class.current_user[:id] : nil)} - instance_variable_get("@#{tag_col_name}").split(/\s*,\s*/).each {|tag| self.send("add#{tag_col_name.singularize}",tag_class.find_or_create(vals_hash.update(:tag => tag))) } + instance_variable_get("@#{tag_col_name}").to_s.split(/\s*,\s*/).each {|tag| self.send("add#{tag_col_name.singularize}",tag_class.find_or_create(vals_hash.update(:tag => tag))) } } end end diff --git a/marley.gemspec b/marley.gemspec index 7b58f7b..15222a0 100644 --- a/marley.gemspec +++ b/marley.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |s| s.name = %q{marley} - s.version = "0.7.2" + s.version = "0.8.0" s.summary = %q{Irie default restful routes for models and other objects} s.description = %q{Marley is a framework for quickly building RESTful web services and applications. Development is fast for two reasons: Marley implements lots of sensible defaults, all of which can be overridden and most of which can be overridden easily. And Marley servers exchange only data and metadata with clients. } s.authors = ["Herb Daily"] diff --git a/rdoc/forum_load.rb b/rdoc/forum_load.rb index 9679e04..a04994e 100644 --- a/rdoc/forum_load.rb +++ b/rdoc/forum_load.rb @@ -50,4 +50,11 @@ end end end +REPLIES.each do |r| + MR::PublicMessage.all.each do |m| + rep=m.reply + rep.user_id=m[:id].modulo USERS + rep.save + end +end