mirror of
https://github.com/danbee/danbarberphoto
synced 2025-03-04 08:49:07 +00:00
Update Monban to Oath
This commit is contained in:
parent
53a0a6259c
commit
e7733b8bf0
5
Gemfile
5
Gemfile
@ -39,7 +39,6 @@ end
|
|||||||
group :test do
|
group :test do
|
||||||
gem 'factory_girl_rails'
|
gem 'factory_girl_rails'
|
||||||
gem 'shoulda'
|
gem 'shoulda'
|
||||||
gem 'shoulda-context'
|
|
||||||
gem 'shoulda-matchers'
|
gem 'shoulda-matchers'
|
||||||
gem 'poltergeist'
|
gem 'poltergeist'
|
||||||
gem 'database_cleaner'
|
gem 'database_cleaner'
|
||||||
@ -58,8 +57,8 @@ gem 'administrate-field-image'
|
|||||||
gem 'dragonfly'
|
gem 'dragonfly'
|
||||||
gem 'dragonfly-s3_data_store'
|
gem 'dragonfly-s3_data_store'
|
||||||
gem 'kaminari'
|
gem 'kaminari'
|
||||||
gem 'monban'
|
gem 'oath'
|
||||||
gem 'monban-generators'
|
gem 'oath-generators'
|
||||||
gem 'nokogiri'
|
gem 'nokogiri'
|
||||||
gem 'pg'
|
gem 'pg'
|
||||||
gem 'kramdown'
|
gem 'kramdown'
|
||||||
|
|||||||
19
Gemfile.lock
19
Gemfile.lock
@ -180,16 +180,16 @@ GEM
|
|||||||
minitest (5.11.3)
|
minitest (5.11.3)
|
||||||
momentjs-rails (2.17.1)
|
momentjs-rails (2.17.1)
|
||||||
railties (>= 3.1)
|
railties (>= 3.1)
|
||||||
monban (1.1.1)
|
|
||||||
bcrypt
|
|
||||||
rails
|
|
||||||
warden
|
|
||||||
monban-generators (1.0.1)
|
|
||||||
monban (>= 0.0.12)
|
|
||||||
multi_json (1.13.1)
|
multi_json (1.13.1)
|
||||||
nio4r (2.2.0)
|
nio4r (2.2.0)
|
||||||
nokogiri (1.8.2)
|
nokogiri (1.8.2)
|
||||||
mini_portile2 (~> 2.3.0)
|
mini_portile2 (~> 2.3.0)
|
||||||
|
oath (1.1.0)
|
||||||
|
bcrypt
|
||||||
|
rails
|
||||||
|
warden
|
||||||
|
oath-generators (1.0.1)
|
||||||
|
oath (>= 0.0.12)
|
||||||
parallel (1.12.1)
|
parallel (1.12.1)
|
||||||
parser (2.4.0.2)
|
parser (2.4.0.2)
|
||||||
ast (~> 2.3)
|
ast (~> 2.3)
|
||||||
@ -351,9 +351,9 @@ DEPENDENCIES
|
|||||||
kaminari
|
kaminari
|
||||||
kramdown
|
kramdown
|
||||||
letter_opener
|
letter_opener
|
||||||
monban
|
|
||||||
monban-generators
|
|
||||||
nokogiri
|
nokogiri
|
||||||
|
oath
|
||||||
|
oath-generators
|
||||||
pg
|
pg
|
||||||
poltergeist
|
poltergeist
|
||||||
powder
|
powder
|
||||||
@ -367,7 +367,6 @@ DEPENDENCIES
|
|||||||
ruby_parser
|
ruby_parser
|
||||||
sass-rails
|
sass-rails
|
||||||
shoulda
|
shoulda
|
||||||
shoulda-context
|
|
||||||
shoulda-matchers
|
shoulda-matchers
|
||||||
simple_form
|
simple_form
|
||||||
simplecov
|
simplecov
|
||||||
@ -379,4 +378,4 @@ RUBY VERSION
|
|||||||
ruby 2.4.2p198
|
ruby 2.4.2p198
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
1.16.0
|
1.16.1
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
# you're free to overwrite the RESTful controller actions.
|
# you're free to overwrite the RESTful controller actions.
|
||||||
module Admin
|
module Admin
|
||||||
class ApplicationController < Administrate::ApplicationController
|
class ApplicationController < Administrate::ApplicationController
|
||||||
include Monban::ControllerHelpers
|
include Oath::ControllerHelpers
|
||||||
|
|
||||||
before_action :require_login
|
before_action :require_login
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
class ApplicationController < ActionController::Base
|
class ApplicationController < ActionController::Base
|
||||||
include Monban::ControllerHelpers
|
include Oath::ControllerHelpers
|
||||||
protect_from_forgery
|
protect_from_forgery
|
||||||
|
|
||||||
rescue_from ActiveRecord::RecordNotFound, with: :render_404
|
rescue_from ActiveRecord::RecordNotFound, with: :render_404
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
require 'monban/constraints/signed_in'
|
require 'oath/constraints/signed_in'
|
||||||
require 'monban/constraints/signed_out'
|
require 'oath/constraints/signed_out'
|
||||||
|
|
||||||
DanBarberPhoto::Application.routes.draw do
|
DanBarberPhoto::Application.routes.draw do
|
||||||
namespace :admin do
|
namespace :admin do
|
||||||
|
|||||||
60
db/schema.rb
60
db/schema.rb
@ -1,4 +1,3 @@
|
|||||||
# encoding: UTF-8
|
|
||||||
# This file is auto-generated from the current state of the database. Instead
|
# This file is auto-generated from the current state of the database. Instead
|
||||||
# of editing this file, please use the migrations feature of Active Record to
|
# of editing this file, please use the migrations feature of Active Record to
|
||||||
# incrementally modify your database, and then regenerate this schema definition.
|
# incrementally modify your database, and then regenerate this schema definition.
|
||||||
@ -17,63 +16,60 @@ ActiveRecord::Schema.define(version: 20151028124718) do
|
|||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
|
|
||||||
create_table "categories", force: :cascade do |t|
|
create_table "categories", force: :cascade do |t|
|
||||||
t.string "name", limit: 255
|
t.string "name", limit: 255
|
||||||
t.text "description"
|
t.text "description"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
t.integer "photo_id"
|
t.integer "photo_id"
|
||||||
t.string "base_colour", limit: 255
|
t.string "base_colour", limit: 255
|
||||||
t.integer "sort"
|
t.integer "sort"
|
||||||
t.string "slug", limit: 255
|
t.string "slug", limit: 255
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "categories_photos", id: false, force: :cascade do |t|
|
create_table "categories_photos", id: false, force: :cascade do |t|
|
||||||
t.integer "category_id"
|
t.integer "category_id"
|
||||||
t.integer "photo_id"
|
t.integer "photo_id"
|
||||||
|
t.index ["category_id", "photo_id"], name: "index_categories_photos_on_category_id_and_photo_id", unique: true
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "categories_photos", ["category_id", "photo_id"], name: "index_categories_photos_on_category_id_and_photo_id", unique: true, using: :btree
|
|
||||||
|
|
||||||
create_table "pages", force: :cascade do |t|
|
create_table "pages", force: :cascade do |t|
|
||||||
t.string "name", limit: 255
|
t.string "name", limit: 255
|
||||||
t.string "title", limit: 255
|
t.string "title", limit: 255
|
||||||
t.text "content"
|
t.text "content"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "photos", force: :cascade do |t|
|
create_table "photos", force: :cascade do |t|
|
||||||
t.string "flickr_url", limit: 255
|
t.string "flickr_url", limit: 255
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
t.string "title", limit: 255
|
t.string "title", limit: 255
|
||||||
t.text "description"
|
t.text "description"
|
||||||
t.integer "sort"
|
t.integer "sort"
|
||||||
t.boolean "featured", default: false
|
t.boolean "featured", default: false
|
||||||
t.boolean "enabled", default: true
|
t.boolean "enabled", default: true
|
||||||
t.datetime "taken_at"
|
t.datetime "taken_at"
|
||||||
t.integer "views", default: 0
|
t.integer "views", default: 0
|
||||||
t.string "image_uid", limit: 255
|
t.string "image_uid", limit: 255
|
||||||
t.string "image_name", limit: 255
|
t.string "image_name", limit: 255
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "sessions", force: :cascade do |t|
|
create_table "sessions", force: :cascade do |t|
|
||||||
t.string "session_id", limit: 255, null: false
|
t.string "session_id", limit: 255, null: false
|
||||||
t.text "data"
|
t.text "data"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
|
t.index ["session_id"], name: "index_sessions_on_session_id"
|
||||||
|
t.index ["updated_at"], name: "index_sessions_on_updated_at"
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "sessions", ["session_id"], name: "index_sessions_on_session_id", using: :btree
|
|
||||||
add_index "sessions", ["updated_at"], name: "index_sessions_on_updated_at", using: :btree
|
|
||||||
|
|
||||||
create_table "users", force: :cascade do |t|
|
create_table "users", force: :cascade do |t|
|
||||||
t.string "email", null: false
|
t.string "email", null: false
|
||||||
t.string "password_digest", limit: 60, null: false
|
t.string "password_digest", limit: 60, null: false
|
||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
t.datetime "updated_at", null: false
|
t.datetime "updated_at", null: false
|
||||||
|
t.index ["email"], name: "index_users_on_email", unique: true
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,12 +1,12 @@
|
|||||||
require "spec_helper"
|
require "spec_helper"
|
||||||
|
|
||||||
describe Contact do
|
describe Contact do
|
||||||
it { should validate_presence_of(:email) }
|
it { is_expected.to validate_presence_of(:email) }
|
||||||
it { should validate_presence_of(:name) }
|
it { is_expected.to validate_presence_of(:name) }
|
||||||
it { should validate_presence_of(:message) }
|
it { is_expected.to validate_presence_of(:message) }
|
||||||
|
|
||||||
it { should allow_value("test@test.com").for(:email) }
|
it { is_expected.to allow_value('test@test.com').for(:email) }
|
||||||
it { should_not allow_value("test@test").for(:email) }
|
it { is_expected.not_to allow_value('test@test').for(:email) }
|
||||||
|
|
||||||
let(:contact) { build(:contact) }
|
let(:contact) { build(:contact) }
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user