hubbub 0.0.6 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,6 +19,7 @@ class ArticlesController < ApplicationController
19
19
 
20
20
  def create
21
21
  @article = Article.new(params[:article])
22
+ @article.user = @current_user
22
23
 
23
24
  if @article.save
24
25
  flash[:notice] = "Success: created article."
@@ -1,4 +1,6 @@
1
1
  class Article < ActiveRecord::Base
2
+ belongs_to :user
3
+
2
4
  validates_presence_of :title
3
5
  validates_presence_of :body
4
6
  validate :valid_tags?
@@ -1,3 +1,6 @@
1
1
  class User < ActiveRecord::Base
2
+ validates_presence_of :openid_identifier
3
+ has_many :articles
4
+
2
5
  acts_as_authentic
3
6
  end
@@ -5,15 +5,18 @@ class CreateArticles < ActiveRecord::Migration
5
5
  t.string :title_slug
6
6
  t.text :body
7
7
  t.text :body_html
8
+ t.integer :user_id
8
9
 
9
10
  t.timestamps
10
11
  end
11
12
 
12
13
  add_index :articles, :title_slug
14
+ add_index :articles, :user_id
13
15
  end
14
16
 
15
17
  def self.down
16
18
  remove_index :articles, :title_slug
19
+ remove_index :articles, :user_id
17
20
 
18
21
  drop_table :articles
19
22
  end
data/lib/db/schema.rb CHANGED
@@ -16,11 +16,13 @@ ActiveRecord::Schema.define(:version => 20091229164415) do
16
16
  t.string "title_slug"
17
17
  t.text "body"
18
18
  t.text "body_html"
19
+ t.integer "user_id"
19
20
  t.datetime "created_at"
20
21
  t.datetime "updated_at"
21
22
  end
22
23
 
23
24
  add_index "articles", ["title_slug"], :name => "index_articles_on_title_slug"
25
+ add_index "articles", ["user_id"], :name => "index_articles_on_user_id"
24
26
 
25
27
  create_table "logins", :force => true do |t|
26
28
  t.string "openid_identifier"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hubbub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - rich
@@ -130,7 +130,6 @@ files:
130
130
  - lib/hubbub.rb
131
131
  - lib/lib/hubbub.rb
132
132
  - lib/lib/tasks/rspec.rake
133
- - lib/public/warp_drive/rails.png
134
133
  - lib/vendor/plugins/make_resourceful/generators/resourceful_scaffold/resourceful_scaffold_generator.rb
135
134
  - lib/vendor/plugins/make_resourceful/generators/resourceful_scaffold/templates/controller.rb
136
135
  - lib/vendor/plugins/make_resourceful/generators/resourceful_scaffold/templates/fixtures.yml
Binary file