Permalink
Browse files

topic_topic & bcrypt

  • Loading branch information...
1 parent 0064fbb commit 359677227472ab881096cbcc47ed50f27180177b @jdwyah committed May 20, 2009
Showing with 12 additions and 2 deletions.
  1. +2 −0 app/models/topic.rb
  2. +4 −0 app/models/topics_topic.rb
  3. +5 −1 app/views/users/show.html.haml
  4. +1 −1 config/environment.rb
View
@@ -1,3 +1,5 @@
class Topic < ActiveRecord::Base
belongs_to :user
+ has_many :topics, :through => :topics_topics, :source => :to
+ has_many :topics_topics, :class_name => 'TopicsTopic', :foreign_key => :from_id
end
@@ -0,0 +1,4 @@
+class TopicsTopic < ActiveRecord::Base
+ belongs_to :to, :class_name => 'Topic', :foreign_key => 'to_id'
+ belongs_to :from, :class_name => 'Topic', :foreign_key => 'from_id'
+end
@@ -3,4 +3,8 @@
%ol
- for topic in @user.topics
%li
- == Title #{topic.title} Type #{topic.type}
+ == Title #{topic.id} #{topic.title} Type #{topic.type}
+ %ol
+ - for has in topic.topics
+ %li
+ == !!!!!Has #{has.title} type #{has.type}
View
@@ -21,7 +21,7 @@
# config.gem "aws-s3", :lib => "aws/s3"
config.gem "haml", :version => '2.0.9'
config.gem "authlogic", :version => "2.0.5"
- config.gem "bcrypt-ruby"
+ config.gem "bcrypt-ruby", :lib => 'bcrypt', :version => "2.0.5"
# Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named

0 comments on commit 3596772

Please sign in to comment.