OSDN Git Service

user check
authoryasushiito <yas@pen-chan.jp>
Sat, 10 Mar 2012 00:28:12 +0000 (09:28 +0900)
committeryasushiito <yas@pen-chan.jp>
Sat, 10 Mar 2012 00:28:12 +0000 (09:28 +0900)
35 files changed:
app/controllers/application_controller.rb
app/controllers/artists_controller.rb
app/controllers/authors_controller.rb
app/controllers/balloon_templates_controller.rb
app/controllers/balloons_controller.rb
app/controllers/comics_controller.rb
app/controllers/common_licenses_controller.rb
app/controllers/home_controller.rb
app/controllers/licenses_controller.rb
app/controllers/original_licenses_controller.rb
app/controllers/original_pictures_controller.rb
app/controllers/panel_pictures_controller.rb
app/controllers/panels_controller.rb
app/controllers/resource_pictures_controller.rb
app/controllers/speach_balloons_controller.rb
app/controllers/speach_templates_controller.rb
app/controllers/speaches_controller.rb
app/controllers/system_pictures_controller.rb
app/models/user.rb
app/views/comics/play.html.erb
app/views/comics/top.html.erb
app/views/home/configure.html.erb
app/views/home/index.html.erb
app/views/home/step2.html.erb
app/views/home/step3.html.erb
app/views/layouts/application.html.erb
app/views/layouts/system.html.erb
app/views/original_pictures/_uploader.html.erb
app/views/original_pictures/browse.html.erb
app/views/original_pictures/show.html.erb
app/views/user_registrations/new.html.erb [moved from app/views/author_registrations/new.html.erb with 100% similarity]
config/routes.rb
db/migrate/20111206091950_create_authors.rb
db/migrate/20120306231650_devise_create_users.rb
db/schema.rb

index 2741dd3..2be2325 100644 (file)
@@ -9,11 +9,13 @@ class ApplicationController < ActionController::Base
         redirect_to :controller => '/system', :action => 'start'
       end
     else
-      if author_signed_in?
-        @artist = if current_author.artist?
-          current_author.artist
+      if user_signed_in?
+        @user = current_user
+        @author = @user.author
+        @artist = if @author and @author.artist?
+          @author.artist
         else
-          Artist.new author_id: current_author.id, email: current_author.email, name: current_author.name
+          Artist.new author_id: @author.id, email: @user.email, name: @author.name, default_license_id: 1
         end
       end
     end
index a2fa524..bfedf19 100644 (file)
@@ -1,5 +1,5 @@
 class ArtistsController < ApplicationController
-  before_filter :authenticate_author!, :only => [:index, :show, :create, :update, :destroy]
+  before_filter :authenticate_user!, :only => [:index, :show, :create, :update, :destroy]
   before_filter :authenticate_admin!, :only => [:list, :browse]
 
   # GET /artists
index a69fffa..6371ffd 100644 (file)
@@ -1,5 +1,5 @@
 class AuthorsController < ApplicationController
-  before_filter :authenticate_author!, :only => [:index, :show]
+  before_filter :authenticate_user!, :only => [:index, :show]
   before_filter :authenticate_admin!, :only => [:list, :browse]
 
   def index
index faa1ca0..e224e2f 100644 (file)
@@ -1,5 +1,5 @@
 class BalloonTemplatesController < ApplicationController
-  before_filter :authenticate_author!, :only => [:index, :show]
+  before_filter :authenticate_user!, :only => [:index, :show]
   before_filter :authenticate_admin!, :only => [:list, :browse]
   
   # GET /balloon_templates
index 69a9232..eb8025c 100644 (file)
@@ -1,5 +1,5 @@
 class BalloonsController < ApplicationController
-  before_filter :authenticate_author!, :only => [:index, :show]
+  before_filter :authenticate_user!, :only => [:index, :show]
   before_filter :authenticate_admin!, :only => [:list, :browse]
   
   # GET /balloons
index c556b09..fdddd7a 100644 (file)
@@ -1,11 +1,11 @@
 class ComicsController < ApplicationController
-  before_filter :authenticate_author!, :only => [:top, :index, :show, :play, :create, :update, :destroy]
+  before_filter :authenticate_user!, :only => [:top, :index, :show, :play, :create, :update, :destroy]
   before_filter :authenticate_admin!, :only => [:list, :browse]
 
   private
   
   def treat_param comic
-    comic.author_id = current_author.id
+    comic.author_id = @author.id
   end
   
   public
@@ -130,7 +130,7 @@ class ComicsController < ApplicationController
   # PUT /comics/1.json
   def update
     @comic = Comic.find(params[:id])
-    if @comic.own? current_author
+    if @comic.own? @author
       respond_to do |format|
         if @comic.update_attributes(params[:comic])
           format.html { redirect_to @comic, notice: 'Comic was successfully updated.' }
@@ -150,7 +150,7 @@ class ComicsController < ApplicationController
   # DELETE /comics/1.json
   def destroy
     @comic = Comic.find(params[:id])
-    if @comic.own? current_author
+    if @comic.own? @author
       @comic.destroy
       respond_to do |format|
         format.html { redirect_to comics_url }
index 8be2039..cefb6d6 100644 (file)
@@ -1,5 +1,5 @@
 class CommonLicensesController < ApplicationController
-  before_filter :authenticate_author!, :only => [:index, :show]
+  before_filter :authenticate_user!, :only => [:index, :show]
   before_filter :authenticate_admin!, :only => [:list, :browse, :new, :edit, :create, :update, :destroy]
 
   # GET /common_licenses
index 0b64ee9..e022d0d 100644 (file)
@@ -1,5 +1,5 @@
 class HomeController < ApplicationController
-  before_filter :authenticate_author!, :only => [
+  before_filter :authenticate_user!, :only => [
     :index, :show, :profile, :configure, :create_token, :delete_token, :step2, :save_step2, :step3, :save_step3, 
     :comic, :picture
   ]
@@ -14,10 +14,9 @@ class HomeController < ApplicationController
   end
   
   def create_token
-    @author = current_author
     respond_to do |format|
-      if @author.create_token
-        format.html { redirect_to({:action => :configure}, {:notice => 'author token was successfully created.'}) }
+      if @user.create_token
+        format.html { redirect_to({:action => :configure}, {:notice => 'user token was successfully created.'}) }
       else
         format.html { render action: "auth_token" }
       end
@@ -25,18 +24,16 @@ class HomeController < ApplicationController
   end
   
   def delete_token
-    current_author.delete_token
+    @user.delete_token
     respond_to do |format|
       format.html { redirect_to :action => :configure}
     end
   end
   
   def step2
-    @author = current_author
   end
   
   def save_step2
-    @author = current_author
     respond_to do |format|
       if @author.step2(params[:author][:name])
         a = if params[:step3].to_i == 1
@@ -52,11 +49,10 @@ class HomeController < ApplicationController
   end
   
   def step3
-    @artist = Artist.new :author_id => current_author.id, :name => current_author.name, :default_license_id => 1
   end
   
   def save_step3
-    if current_author.artist?
+    if @author.artist?
       redirect_to :action => :index
     else
       @artist = Artist.new params[:artist]
@@ -72,7 +68,7 @@ class HomeController < ApplicationController
   
   def comic
     @comics = Comic.find(:all, 
-      :include => :author, :conditions => ['author_id = ?', current_author.id], 
+      :include => :author, :conditions => ['author_id = ?', @author.id], 
       :order => 'updated_at desc', :limit => 20
     )
 
@@ -83,9 +79,9 @@ class HomeController < ApplicationController
   end
   
   def picture
-    if current_author.artist?
+    if @author.artist?
       @original_pictures = OriginalPicture.find(:all, 
-        :include => [:artist, :license, :resource_picture], :conditions => ['artist_id = ?', current_author.artist.id], 
+        :include => [:artist, :license, :resource_picture], :conditions => ['artist_id = ?', @author.artist.id], 
         :order => 'updated_at', :limit => 20
       )
 
index e5e88c8..b92b0b9 100644 (file)
@@ -1,5 +1,5 @@
 class LicensesController < ApplicationController
-  before_filter :authenticate_author!, :only => [:index, :show]
+  before_filter :authenticate_user!, :only => [:index, :show]
   before_filter :authenticate_admin!, :only => [:list, :browse]
 
   # GET /licenses
index 9987894..a88d3ea 100644 (file)
@@ -1,5 +1,5 @@
 class OriginalLicensesController < ApplicationController
-  before_filter :authenticate_author!, :only => [:index, :show, :new, :edit, :create, :update, :destroy]
+  before_filter :authenticate_user!, :only => [:index, :show, :new, :edit, :create, :update, :destroy]
   before_filter :authenticate_admin!, :only => [:list, :browse]
 
   # GET /original_licenses
@@ -62,7 +62,7 @@ class OriginalLicensesController < ApplicationController
   # POST /original_licenses.json
   def create
     @original_license = OriginalLicense.new(params[:original_license])
-    @original_license.artist_id = current_author.artist.id
+    @original_license.artist_id = @author.artist.id
     respond_to do |format|
       if @original_license.save_save
         format.html { redirect_to @original_license, notice: 'Original license was successfully created.' }
index 85c77df..694f57d 100644 (file)
@@ -1,5 +1,5 @@
 class OriginalPicturesController < ApplicationController
-  before_filter :authenticate_author!, :only => [:index, :show, :new, :edit, :create, :update, :destroy]
+  before_filter :authenticate_user!, :only => [:index, :show, :new, :edit, :create, :update, :destroy]
   before_filter :authenticate_admin!, :only => [:list, :browse]
 
   private
@@ -122,8 +122,8 @@ class OriginalPicturesController < ApplicationController
     end
     @original_picture = OriginalPicture.new
     img = set_image params
-    @original_picture.artist_id = current_author.artist.id
-    @original_picture.license_id = current_author.artist.default_license_id
+    @original_picture.artist_id = @author.artist.id
+    @original_picture.license_id = @author.artist.default_license_id
 
     respond_to do |format|
       OriginalPicture.transaction do
@@ -154,7 +154,7 @@ class OriginalPicturesController < ApplicationController
       return
     end
     @original_picture = OriginalPicture.find(params[:id])
-    unless @original_picture.own? current_author
+    unless @original_picture.own? @author
       respond_to do |format|
         format.html { redirect_to @original_picture, notice: 'Failed! ' }
         format.json { render json: @original_picture.errors, status: :unprocessable_entity }
@@ -192,7 +192,7 @@ class OriginalPicturesController < ApplicationController
       return
     end
     @original_picture = OriginalPicture.find(params[:id])
-    unless @original_picture.own? current_author
+    unless @original_picture.own? @author
       respond_to do |format|
         format.html { redirect_to @original_picture, notice: 'Failed! ' }
         format.json { render json: @original_picture.errors, status: :unprocessable_entity }
index 37594b7..95ea5ff 100644 (file)
@@ -1,5 +1,5 @@
 class PanelPicturesController < ApplicationController
-  before_filter :authenticate_author!, :only => [:index, :show]
+  before_filter :authenticate_user!, :only => [:index, :show]
   before_filter :authenticate_admin!, :only => [:list, :browse]
 
   # GET /panel_pictures
index 82475e9..175721d 100644 (file)
@@ -1,11 +1,11 @@
 class PanelsController < ApplicationController
-  before_filter :authenticate_author!, :only => [:index, :show, :create, :update, :destroy]
+  before_filter :authenticate_user!, :only => [:index, :show, :create, :update, :destroy]
   before_filter :authenticate_admin!, :only => [:list, :browse]
 
   private
   
   def treat_param panel
-    panel.author_id = current_author.id
+    panel.author_id = @author.id
   end
   
   public
@@ -87,7 +87,7 @@ class PanelsController < ApplicationController
   # PUT /panels/1.json
   def update
     @panel = Panel.find(params[:id])
-    if @panel.own? current_author
+    if @panel.own? @author
       respond_to do |format|
         Panel.transaction do
           if params[:panel][:t] and params[:panel][:t].to_i != @panel.t
@@ -112,7 +112,7 @@ class PanelsController < ApplicationController
   # DELETE /panels/1.json
   def destroy
     @panel = Panel.find(params[:id])
-    if @panel.own? current_author
+    if @panel.own? @author
       respond_to do |format|
         Panel.transaction do
           @panel.destroy_and_shorten
index dd6879e..4b17772 100644 (file)
@@ -1,5 +1,5 @@
 class ResourcePicturesController < ApplicationController
-  before_filter :authenticate_author!, :only => [:index, :show]
+  before_filter :authenticate_user!, :only => [:index, :show]
   before_filter :authenticate_admin!, :only => [:list, :browse]
 
   # GET /resource_pictures
index 1072cc9..c198b99 100644 (file)
@@ -1,5 +1,5 @@
 class SpeachBalloonsController < ApplicationController
-  before_filter :authenticate_author!, :only => [:index, :show]
+  before_filter :authenticate_user!, :only => [:index, :show]
   before_filter :authenticate_admin!, :only => [:list, :browse, :create, :update, :destroy]
 
   private
index ddc3011..df60b69 100644 (file)
@@ -1,5 +1,5 @@
 class SpeachTemplatesController < ApplicationController
-  before_filter :authenticate_author!, :only => [:index, :show]
+  before_filter :authenticate_user!, :only => [:index, :show]
   before_filter :authenticate_admin!, :only => [:list, :browse]
 
   # GET /speach_templates
index 1619319..35a5595 100644 (file)
@@ -1,5 +1,5 @@
 class SpeachesController < ApplicationController
-  before_filter :authenticate_author!, :only => [:index, :show]
+  before_filter :authenticate_user!, :only => [:index, :show]
   before_filter :authenticate_admin!, :only => [:list, :browse]
 
   # GET /speaches
index 8843d8d..884d33c 100644 (file)
@@ -1,5 +1,5 @@
 class SystemPicturesController < ApplicationController
-  before_filter :authenticate_author!, :only => [:index, :show]
+  before_filter :authenticate_user!, :only => [:index, :show]
   before_filter :authenticate_admin!, :only => [:list, :browse, :create, :update, :destroy]
 
   private
index 90958af..ff5f34e 100644 (file)
@@ -9,6 +9,10 @@ class User < ActiveRecord::Base
   # Setup accessible (or protected) attributes for your model
   attr_accessible :id, :name, :password, :password_confirmation, :remember_me , :email
 
+  before_create do |r|
+    r.build_author :name => 'no name'
+  end
+  
   def create_token
     self.ensure_authentication_token
     self.save
index 8084e33..ef30421 100644 (file)
@@ -1,23 +1,21 @@
 <h1><%= h @comic.title %></h1>
-<% if author_signed_in? -%>
-  <% if @comic.own? current_author -%>
-    <div>
-      <p id="notice"><%= notice %></p>
-      <p>
-        <b>Title:</b>
-        <%= h @comic.title %>
-      </p>
-      <p>
-        <b>visible:</b>
-        <%= @comic.visible %>
-      </p>
-      <p>
-        <b>editable:</b>
-        <%= @comic.editable %>
-      </p>
-      <%= link_to 'Destroy', @comic, confirm: 'Are you sure?', method: :delete %>
-    </div>
-  <% end -%>
+<% if @comic.own? @author -%>
+<div>
+  <p id="notice"><%= notice %></p>
+  <p>
+    <b>Title:</b>
+    <%= h @comic.title %>
+  </p>
+  <p>
+    <b>visible:</b>
+    <%= @comic.visible %>
+  </p>
+  <p>
+    <b>editable:</b>
+    <%= @comic.editable %>
+  </p>
+  <%= link_to 'Destroy', @comic, confirm: 'Are you sure?', method: :delete %>
+</div>
 <% end -%>
 
 <% @comic.panels.each do |panel| %>
index 6b20254..1e260f0 100644 (file)
@@ -17,8 +17,8 @@
     <td><%= comic.author_id%></td>
     <td><%= comic.updated_at %></td>
     <td>
-      <% if author_signed_in? -%>
-        <% if comic.own? current_author -%>
+      <% if user_signed_in? -%>
+        <% if comic.own? @author -%>
           <%= link_to 'Destroy', comic, confirm: 'Are you sure?', method: :delete %>
         <% end -%>
       <% end -%>
index 38b80af..02196cd 100644 (file)
@@ -1,9 +1,9 @@
 <h2>認証トークン</h2>
 <div>
-あなたの認証トークンは<%= current_author.authentication_token %>です
+あなたの認証トークンは<%= @user.authentication_token %>です
 </div>
 <div>
-  <% if current_author.authentication_token %>
+  <% if @user.authentication_token %>
     <%= link_to 'delete token', :action => :delete_token %>
   <% else %>
     <%= link_to 'generate token', :action => :create_token %>
@@ -11,5 +11,5 @@
 </div>
 <h2>退会</h2>
 <div>
-  <%= link_to('退会する', {:controller => 'author_registrations', :action => :destroy, :id => current_author.id}, {:method => :delete}) %>
+  <%= link_to('退会する', {:controller => 'user_registrations', :action => :destroy, :id => @user.id}, {:method => :delete}) %>
 </div>
index ea26dcb..26ddf73 100644 (file)
@@ -1,11 +1,12 @@
-<h1><%= h(current_author.name) -%>(<%= h(current_author.email) -%>)</h1>
+<h1><%= h(@author.name) -%>(<%= h(@user.email) -%>)</h1>
 
 <div>
 <p>絵師活動</p>
-<% if current_author.artist? -%>
-  <%= link_to h(current_author.artist.name), current_author.artist %>です
+<% if @author.artist? -%>
+  <%= link_to h(@author.artist.name), @author.artist %>です
 <% else -%>
   <p>まだ絵師登録していません。</p>
   <p>登録する</p>
+    <%= render 'original_pictures/artist_register' %>
 <% end -%>
 </div>
index 8b10327..0b69bf4 100644 (file)
@@ -1,6 +1,6 @@
 <h1>ようこそ、ぺったんRへ</h1>
 <div>
-<%= h(current_author.email) -%>さんはぺったんRで作家としてデビューしました。
+<%= h(@user.email) -%>さんはぺったんRで作家としてデビューしました。
 今すぐにでも作品を作れますが、より良い活動をするために作家名を登録してください。
 </div>
 <%= form_for(:author, :url => {:controller => '/home', :action => :save_step2}) do |f| %>
index 73a0bd8..9c1941c 100644 (file)
@@ -1,5 +1,5 @@
 <h1>ようこそ、ぺったんRへ</h1>
-<%= h(current_author.name) -%>さん
+<%= h(@author.name) -%>さん
 <div>
   <%= form_for(:artist, :url => {:controller => '/home', :action => :save_step3}) do |f| %>
     <% if @artist.errors.any? %>
index be0c608..d7106a6 100644 (file)
 
 <a href="/">ぺったんR</a>
 <div>
-<% if author_signed_in? %>
+<% if user_signed_in? %>
   <%= link_to "my home", :controller => '/home' %>
   <%= link_to "my comics", :controller => '/home', :action => :comic %>
   <%= link_to "my pictures", :controller => '/home', :action => :picture %>
   <%= link_to "config", :controller => '/home', :action => :configure %>
-  <%= link_to "ログアウト", destroy_author_session_path, :method => :delete %>
+  <%= link_to "ログアウト", destroy_user_session_path, :method => :delete %>
 <% else %>
-  <%= link_to "ログイン", new_author_session_path %>
+  <%= link_to "ログイン", new_user_session_path %>
 <% end %>
 </div>
 <div>
index 7aaa4b9..8c8712e 100644 (file)
 
 <a href="/">ぺったんR</a>
 <div>
-<% if author_signed_in? %>
+<% if user_signed_in? %>
   <%= link_to "my home", :controller => '/home' %>
-  <%= link_to "ログアウト", destroy_author_session_path, :method => :delete %>
+  <%= link_to "ログアウト", destroy_user_session_path, :method => :delete %>
 <% else %>
-  <%= link_to "ログイン", new_author_session_path %>
+  <%= link_to "ログイン", new_user_session_path %>
 <% end %>
 </div>
 <div>
index b09314a..7b52a5e 100644 (file)
@@ -1,14 +1,14 @@
-<% if author_signed_in? -%>
-  <% if current_author.artist? -%>
+<% if user_signed_in? -%>
+  <% if @author.artist? -%>
     <%= form_tag( {:action => "create"} , { :multipart => true }) do %>
       <label for="file">File to Upload</label> <%= file_field_tag "original_picture[file]" %>
       license
-      <%= collection_select :original_picture, :license_id, License.all.map {|l| [l.name, l.id] }, :last, :first, :html => {:selected => current_author.artist.default_license_id} %>
+      <%= collection_select :original_picture, :license_id, License.all.map {|l| [l.name, l.id] }, :last, :first, :html => {:selected => @author.artist.default_license_id} %>
       <%= submit_tag 'upload' -%>
     <% end -%>
   <% else -%>
     <%= render 'artist_register' %>
   <% end -%>
 <% else -%>
-  素材を投稿するなら<%= link_to "ログイン", new_author_session_path %>
+  素材を投稿するなら<%= link_to "ログイン", new_user_session_path %>
 <% end -%>
index 4eb5bb0..fe317a2 100644 (file)
@@ -38,7 +38,7 @@
 <p>
 <%= link_to '再生成', :action => :refresh, :id => @original_picture.id %>
 </p>
-<% if @original_picture.own? current_author -%>
+<% if @original_picture.own? @author -%>
 <p>
 Replace picture
 </p>
index a48ef44..858d167 100644 (file)
@@ -33,7 +33,7 @@
 <p>
 <%= link_to '再生成', :action => :refresh, :id => @original_picture.id %>
 </p>
-<% if @original_picture.own? current_author -%>
+<% if @original_picture.own? @author -%>
 <p>
 Replace picture
 </p>
index a06d818..5ba523c 100644 (file)
@@ -1,6 +1,6 @@
 Pettanr::Application.routes.draw do
 
-  devise_for :users, :controllers => { :registrations => "user_registrations" }
+  devise_for :users , :controllers => { :registrations => "user_registrations" }
   devise_for :admins
 
   match 'original_pictures/:id(.:format)/refresh' => 'original_pictures#refresh'
index c2dc72f..d7db541 100644 (file)
@@ -7,11 +7,7 @@ class CreateAuthors < ActiveRecord::Migration
       t.timestamps
     end
 
-    add_index :authors, :email,                :unique => true
-    add_index :authors, :reset_password_token, :unique => true
-    add_index :authors, :confirmation_token,   :unique => true
-    # add_index :authors, :unlock_token,         :unique => true
-    add_index :authors, :authentication_token, :unique => true
+    add_index :authors, :user_id,                :unique => true
   end
 
 end
index 6372e99..915a976 100644 (file)
@@ -15,11 +15,11 @@ class DeviseCreateUsers < ActiveRecord::Migration
       t.timestamps
     end
 
-    add_index :authors, :email,                :unique => true
-    add_index :authors, :reset_password_token, :unique => true
-    add_index :authors, :confirmation_token,   :unique => true
-    # add_index :authors, :unlock_token,         :unique => true
-    add_index :authors, :authentication_token, :unique => true
+    add_index :users, :email,                :unique => true
+    add_index :users, :reset_password_token, :unique => true
+    add_index :users, :confirmation_token,   :unique => true
+    # add_index :users, :unlock_token,         :unique => true
+    add_index :users, :authentication_token, :unique => true
   end
 
 end
index 454f5d3..6160bd6 100644 (file)
@@ -11,7 +11,7 @@
 #\r
 # It's strongly recommended to check this file into your version control system.\r
 \r
-ActiveRecord::Schema.define(:version => 20120102071851) do\r
+ActiveRecord::Schema.define(:version => 20120306231650) do\r
 \r
   create_table "admins", :force => true do |t|\r
     t.string   "email",                                 :default => "", :null => false\r
@@ -43,7 +43,7 @@ ActiveRecord::Schema.define(:version => 20120102071851) do
     t.string   "name"\r
     t.string   "homepage_url"\r
     t.string   "api_url"\r
-    t.integer  "default_license_id"\r
+    t.integer  "default_license_id", :default => 0, :null => false\r
     t.datetime "crowled_at"\r
     t.datetime "created_at"\r
     t.datetime "updated_at"\r
@@ -52,28 +52,12 @@ ActiveRecord::Schema.define(:version => 20120102071851) do
 \r
   create_table "authors", :force => true do |t|\r
     t.string   "name"\r
-    t.string   "email",                                 :default => "", :null => false\r
-    t.string   "encrypted_password",     :limit => 128, :default => "", :null => false\r
-    t.string   "reset_password_token"\r
-    t.datetime "reset_password_sent_at"\r
-    t.datetime "remember_created_at"\r
-    t.integer  "sign_in_count",                         :default => 0\r
-    t.datetime "current_sign_in_at"\r
-    t.datetime "last_sign_in_at"\r
-    t.string   "current_sign_in_ip"\r
-    t.string   "last_sign_in_ip"\r
-    t.string   "authentication_token"\r
-    t.string   "confirmation_token"\r
-    t.datetime "confirmed_at"\r
-    t.datetime "confirmation_sent_at"\r
+    t.integer  "user_id",    :default => 0, :null => false\r
     t.datetime "created_at"\r
     t.datetime "updated_at"\r
   end\r
 \r
-  add_index "authors", ["authentication_token"], :name => "index_authors_on_authentication_token", :unique => true\r
-  add_index "authors", ["confirmation_token"], :name => "index_authors_on_confirmation_token", :unique => true\r
-  add_index "authors", ["email"], :name => "index_authors_on_email", :unique => true\r
-  add_index "authors", ["reset_password_token"], :name => "index_authors_on_reset_password_token", :unique => true\r
+  add_index "authors", ["user_id"], :name => "index_authors_on_user_id", :unique => true\r
 \r
   create_table "balloon_templates", :force => true do |t|\r
     t.integer  "speach_balloon_id",                :null => false\r
@@ -174,12 +158,12 @@ ActiveRecord::Schema.define(:version => 20120102071851) do
   end\r
 \r
   create_table "original_pictures", :force => true do |t|\r
-    t.string   "ext",        :null => false\r
-    t.integer  "width",      :null => false\r
-    t.integer  "height",     :null => false\r
-    t.integer  "filesize",   :null => false\r
-    t.integer  "artist_id"\r
-    t.integer  "license_id"\r
+    t.string   "ext",                       :null => false\r
+    t.integer  "width",                     :null => false\r
+    t.integer  "height",                    :null => false\r
+    t.integer  "filesize",                  :null => false\r
+    t.integer  "artist_id",  :default => 0, :null => false\r
+    t.integer  "license_id", :default => 0, :null => false\r
     t.datetime "created_at"\r
     t.datetime "updated_at"\r
   end\r
@@ -196,8 +180,6 @@ ActiveRecord::Schema.define(:version => 20120102071851) do
     t.integer  "t",                                  :default => 1, :null => false\r
     t.integer  "width",                                             :null => false\r
     t.integer  "height",                                            :null => false\r
-    t.integer  "flipv",                              :default => 0, :null => false\r
-    t.integer  "fliph",                              :default => 0, :null => false\r
     t.datetime "created_at"\r
     t.datetime "updated_at"\r
   end\r
@@ -223,13 +205,13 @@ ActiveRecord::Schema.define(:version => 20120102071851) do
   add_index "panels", ["comic_id", "t"], :name => "panels_idt", :unique => true\r
 \r
   create_table "resource_pictures", :force => true do |t|\r
-    t.string   "ext",                 :null => false\r
-    t.integer  "width",               :null => false\r
-    t.integer  "height",              :null => false\r
-    t.integer  "filesize",            :null => false\r
-    t.integer  "artist_id"\r
-    t.integer  "license_id"\r
-    t.integer  "original_picture_id", :null => false\r
+    t.string   "ext",                                :null => false\r
+    t.integer  "width",                              :null => false\r
+    t.integer  "height",                             :null => false\r
+    t.integer  "filesize",                           :null => false\r
+    t.integer  "artist_id",           :default => 0, :null => false\r
+    t.integer  "license_id",          :default => 0, :null => false\r
+    t.integer  "original_picture_id",                :null => false\r
     t.datetime "created_at"\r
     t.datetime "updated_at"\r
   end\r
@@ -282,4 +264,28 @@ ActiveRecord::Schema.define(:version => 20120102071851) do
     t.datetime "updated_at"\r
   end\r
 \r
+  create_table "users", :force => true do |t|\r
+    t.string   "email",                                 :default => "", :null => false\r
+    t.string   "encrypted_password",     :limit => 128, :default => "", :null => false\r
+    t.string   "reset_password_token"\r
+    t.datetime "reset_password_sent_at"\r
+    t.datetime "remember_created_at"\r
+    t.integer  "sign_in_count",                         :default => 0\r
+    t.datetime "current_sign_in_at"\r
+    t.datetime "last_sign_in_at"\r
+    t.string   "current_sign_in_ip"\r
+    t.string   "last_sign_in_ip"\r
+    t.string   "authentication_token"\r
+    t.string   "confirmation_token"\r
+    t.datetime "confirmed_at"\r
+    t.datetime "confirmation_sent_at"\r
+    t.datetime "created_at"\r
+    t.datetime "updated_at"\r
+  end\r
+\r
+  add_index "users", ["authentication_token"], :name => "index_users_on_authentication_token", :unique => true\r
+  add_index "users", ["confirmation_token"], :name => "index_users_on_confirmation_token", :unique => true\r
+  add_index "users", ["email"], :name => "index_users_on_email", :unique => true\r
+  add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true\r
+\r
 end\r