diff --git a/Gemfile b/Gemfile index 4b7e0dc..fb58607 100644 --- a/Gemfile +++ b/Gemfile @@ -102,3 +102,6 @@ gem 'cookies_eu' # Requires: apt-get install libbz2-dev gem 'bzip2-ruby', :git => 'https://github.com/chewi/bzip2-ruby.git' + +# Authentication +gem 'authlogic' diff --git a/Gemfile.lock b/Gemfile.lock index 9b96332..85c8f19 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -43,6 +43,11 @@ GEM thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) arel (6.0.0) + authlogic (3.4.5) + activerecord (>= 3.2) + activesupport (>= 3.2) + request_store (~> 1.0) + scrypt (~> 1.2) better_errors (2.1.1) coderay (>= 1.0.0) erubis (>= 2.6.6) @@ -83,6 +88,9 @@ GEM fancybox2-rails (0.2.8) railties (>= 3.1.0, < 5.0) ffi (1.9.8) + ffi-compiler (0.1.3) + ffi (>= 1.0.0) + rake formatador (0.2.5) foundation-rails (5.5.1.2) railties (>= 3.1.0) @@ -194,6 +202,7 @@ GEM rdoc (4.2.0) json (~> 1.4) ref (1.0.5) + request_store (1.1.0) ruby-graphviz (1.0.9) sass (3.4.13) sass-rails (5.0.3) @@ -202,6 +211,9 @@ GEM sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (~> 1.1) + scrypt (1.2.1) + ffi-compiler (>= 0.0.2) + rake sdoc (0.4.1) json (~> 1.7, >= 1.7.7) rdoc (~> 4.0) @@ -250,6 +262,7 @@ PLATFORMS ruby DEPENDENCIES + authlogic better_errors binding_of_caller byebug diff --git a/app/models/user.rb b/app/models/user.rb new file mode 100644 index 0000000..4a57cf0 --- /dev/null +++ b/app/models/user.rb @@ -0,0 +1,2 @@ +class User < ActiveRecord::Base +end diff --git a/db/migrate/20150503133405_create_users.rb b/db/migrate/20150503133405_create_users.rb new file mode 100644 index 0000000..51330f2 --- /dev/null +++ b/db/migrate/20150503133405_create_users.rb @@ -0,0 +1,11 @@ +class CreateUsers < ActiveRecord::Migration + def change + create_table :users do |t| + t.text :email + t.text :realname + t.text :password + + t.timestamps null: false + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 3c80f5f..06da12d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20150503130412) do +ActiveRecord::Schema.define(version: 20150503133405) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -65,6 +65,9 @@ ActiveRecord::Schema.define(version: 20150503130412) do add_index "screenshots", ["id", "uploaderhash"], name: "id_uploaderhash", using: :btree create_table "users", force: :cascade do |t| + t.text "email" + t.text "realname" + t.text "password" t.datetime "created_at", null: false t.datetime "updated_at", null: false end diff --git a/test/models/user_test.rb b/test/models/user_test.rb new file mode 100644 index 0000000..32b0a18 --- /dev/null +++ b/test/models/user_test.rb @@ -0,0 +1,13 @@ +require "test_helper" + +class UserTest < ActiveSupport::TestCase + + def user + @user ||= User.new + end + + def test_valid + assert user.valid? + end + +end