Skip to content

Commit

Permalink
reggae_instace_list appears to be working. need to implement js
Browse files Browse the repository at this point in the history
  • Loading branch information
herbdaily committed Mar 29, 2012
1 parent 70fef09 commit e9a5afb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/marley/joints/forum.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/marley/joints/tags.rb
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion marley.gemspec
Expand Up @@ -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"]
Expand Down
7 changes: 7 additions & 0 deletions rdoc/forum_load.rb
Expand Up @@ -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

0 comments on commit e9a5afb

Please sign in to comment.