Skip to content

Commit 00513ba

Browse files
authored
Merge pull request #73 from Threespot/v3.0
v3.0
2 parents e60c5e3 + 83e2bfd commit 00513ba

File tree

9 files changed

+78
-74
lines changed

9 files changed

+78
-74
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
language: ruby
22
rvm:
3-
- 2.3.1
3+
- 2.6.3
44
script: "rake test"

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Tolaria is a [content management system](https://en.wikipedia.org/wiki/Content_m
2121
- Easily overridable on a case-by-case basis.
2222
- Designed for use on Heroku, in containers, and on websites with TLS.
2323
- Modest dependencies.
24-
- Compatible with Rails 5 and Rails 4.2.
24+
- Compatible with Rails 6, 5 and Rails 4.2.
2525

2626
### Browser Support
2727

@@ -32,6 +32,9 @@ Tolaria supports IE10+, Edge, Safari, Chrome, Firefox, iOS, and Chrome for Andro
3232
Add Tolaria to your project's `Gemfile`:
3333

3434
```ruby
35+
# If you are running Rails 6, use Tolaria 3
36+
gem "tolaria", "~> 3.0"
37+
3538
# If you are running Rails 5, use Tolaria 2
3639
gem "tolaria", "~> 2.0"
3740

@@ -197,7 +200,7 @@ See the [TableHelper documentation](http://www.rubydoc.info/gems/tolaria/Admin/T
197200

198201
Tolaria does not build editing forms for you, but it attempts to help speed up your work by providing a wrapper.
199202

200-
If your model was `BlogPost`, you'll need to create a file in your project at `app/views/admin/blog_posts/_form.html.erb`. You'll provide the form code that would appear inside the `form_for` block, excluding the submit buttons. The builder variable is `f`.
203+
If your model was `BlogPost`, you'll need to create a file in your project at `app/views/admin/blog_posts/_form.html.erb`. You'll provide the form code that would appear inside the `form_for` block, excluding the submit buttons. The builder variable is `f`.
201204

202205
```erb
203206
<% # app/views/admin/blog_posts/_form.html.erb %>
@@ -268,7 +271,7 @@ By default, Tolaria provides a single search field that searches over all of the
268271

269272
**Important:** This system uses the [Ransack gem][ransack], which you'll need to familiarize yourself with.
270273

271-
If your model was `BlogPost`, you'll need to create a file in your project at `app/views/admin/blog_posts/_search.html.erb`. You'll provide the form code that would appear inside the `search_form_for` block, excluding the submit buttons. The builder variable is `f`.
274+
If your model was `BlogPost`, you'll need to create a file in your project at `app/views/admin/blog_posts/_search.html.erb`. You'll provide the form code that would appear inside the `search_form_for` block, excluding the submit buttons. The builder variable is `f`.
272275

273276
```erb
274277
<% # app/views/admin/blog_posts/_search.html.erb %>

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ task :server do
3939
binding = ENV.fetch("BIND_ON", "0.0.0.0")
4040
Dir.chdir "#{TOLARIA_ROOT}/test/demo"
4141
system "./bin/rake db:migrate"
42-
exec "./bin/rails server --environment development --bind #{binding} --port #{port}"
42+
exec "./bin/rails server --environment development --port #{port}"
4343
end
4444

4545
desc "Start a Rails console with Tolaria loaded"

lib/tolaria/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module Tolaria
22

33
# Returns Tolaria’s version number
44
def self.version
5-
Gem::Version.new("2.0.4")
5+
Gem::Version.new("3.0.0")
66
end
77

88
module VERSION

test/demo/db/schema.rb

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -2,104 +2,104 @@
22
# of editing this file, please use the migrations feature of Active Record to
33
# incrementally modify your database, and then regenerate this schema definition.
44
#
5-
# Note that this schema.rb definition is the authoritative source for your
6-
# database schema. If you need to create the application database on another
7-
# system, you should be using db:schema:load, not running all the migrations
8-
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
9-
# you'll amass, the slower it'll run and the greater likelihood for issues).
5+
# This file is the source Rails uses to define your schema when running `rails
6+
# db:schema:load`. When creating a new database, `rails db:schema:load` tends to
7+
# be faster and is potentially less error prone than running all of your
8+
# migrations from scratch. Old migrations may fail to apply correctly if those
9+
# migrations use external dependencies or application code.
1010
#
1111
# It's strongly recommended that you check this file into your version control system.
1212

13-
ActiveRecord::Schema.define(version: 20150610135235) do
13+
ActiveRecord::Schema.define(version: 2015_06_10_135235) do
1414

1515
create_table "administrators", force: :cascade do |t|
1616
t.datetime "created_at"
1717
t.datetime "updated_at"
18-
t.string "email", null: false
19-
t.string "name", null: false
20-
t.string "organization", null: false
21-
t.string "passcode", limit: 60, null: false
22-
t.datetime "passcode_expires_at", null: false
23-
t.string "auth_token", limit: 32, null: false
24-
t.datetime "account_unlocks_at", null: false
25-
t.integer "lockout_strikes", default: 0, null: false
26-
t.integer "total_strikes", default: 0, null: false
27-
t.integer "sessions_created", default: 0, null: false
18+
t.string "email", null: false
19+
t.string "name", null: false
20+
t.string "organization", null: false
21+
t.string "passcode", limit: 60, null: false
22+
t.datetime "passcode_expires_at", null: false
23+
t.string "auth_token", limit: 32, null: false
24+
t.datetime "account_unlocks_at", null: false
25+
t.integer "lockout_strikes", default: 0, null: false
26+
t.integer "total_strikes", default: 0, null: false
27+
t.integer "sessions_created", default: 0, null: false
2828
t.index ["auth_token"], name: "index_administrators_on_auth_token"
2929
t.index ["email"], name: "index_administrators_on_email"
3030
end
3131

3232
create_table "blog_post_topics", force: :cascade do |t|
3333
t.integer "blog_post_id", null: false
34-
t.integer "topic_id", null: false
34+
t.integer "topic_id", null: false
3535
t.index ["blog_post_id"], name: "index_blog_post_topics_on_blog_post_id"
3636
t.index ["topic_id"], name: "index_blog_post_topics_on_topic_id"
3737
end
3838

3939
create_table "blog_posts", force: :cascade do |t|
40-
t.datetime "created_at", null: false
41-
t.datetime "updated_at", null: false
42-
t.string "title", null: false
40+
t.datetime "created_at", null: false
41+
t.datetime "updated_at", null: false
42+
t.string "title", null: false
4343
t.datetime "published_at", null: false
44-
t.text "summary"
45-
t.text "body"
46-
t.string "color"
47-
t.text "portrait"
48-
t.text "attachment"
44+
t.text "summary"
45+
t.text "body"
46+
t.string "color"
47+
t.text "portrait"
48+
t.text "attachment"
4949
end
5050

5151
create_table "footnotes", force: :cascade do |t|
52-
t.datetime "created_at", null: false
53-
t.datetime "updated_at", null: false
54-
t.integer "blog_post_id", null: false
55-
t.text "description"
56-
t.text "url"
52+
t.datetime "created_at", null: false
53+
t.datetime "updated_at", null: false
54+
t.integer "blog_post_id", null: false
55+
t.text "description"
56+
t.text "url"
5757
t.index ["blog_post_id"], name: "index_footnotes_on_blog_post_id"
5858
end
5959

6060
create_table "images", force: :cascade do |t|
61-
t.datetime "created_at", null: false
62-
t.datetime "updated_at", null: false
63-
t.string "title", null: false
64-
t.text "alternate_text"
65-
t.text "credit"
66-
t.text "keywords"
67-
t.text "attachment_address", null: false
61+
t.datetime "created_at", null: false
62+
t.datetime "updated_at", null: false
63+
t.string "title", null: false
64+
t.text "alternate_text"
65+
t.text "credit"
66+
t.text "keywords"
67+
t.text "attachment_address", null: false
6868
end
6969

7070
create_table "legal_pages", force: :cascade do |t|
7171
t.datetime "created_at", null: false
7272
t.datetime "updated_at", null: false
73-
t.string "title", null: false
74-
t.string "slug", null: false
75-
t.text "summary", null: false
76-
t.text "body"
73+
t.string "title", null: false
74+
t.string "slug", null: false
75+
t.text "summary", null: false
76+
t.text "body"
7777
t.index ["slug"], name: "index_legal_pages_on_slug"
7878
end
7979

8080
create_table "miscellany", force: :cascade do |t|
81-
t.datetime "created_at", null: false
82-
t.datetime "updated_at", null: false
83-
t.string "key", null: false
84-
t.text "value", null: false
85-
t.text "description", null: false
81+
t.datetime "created_at", null: false
82+
t.datetime "updated_at", null: false
83+
t.string "key", null: false
84+
t.text "value", null: false
85+
t.text "description", null: false
8686
t.index ["key"], name: "index_miscellany_on_key"
8787
end
8888

8989
create_table "topics", force: :cascade do |t|
9090
t.datetime "created_at"
9191
t.datetime "updated_at"
92-
t.string "label", null: false
93-
t.string "slug", null: false
92+
t.string "label", null: false
93+
t.string "slug", null: false
9494
t.index ["slug"], name: "index_topics_on_slug"
9595
end
9696

9797
create_table "videos", force: :cascade do |t|
98-
t.datetime "created_at", null: false
99-
t.datetime "updated_at", null: false
100-
t.string "title", null: false
101-
t.string "youtube_id", null: false
102-
t.string "description"
98+
t.datetime "created_at", null: false
99+
t.datetime "updated_at", null: false
100+
t.string "title", null: false
101+
t.string "youtube_id", null: false
102+
t.string "description"
103103
end
104104

105105
end

test/integration/filter_preservation_test.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def teardown
1616
find_link("Organization").click
1717
find_link("Nintendo").click
1818
first(".crumb a").click
19-
assert page.current_url.include?("q[s]=organization+asc"), "filter not retained"
19+
assert page.current_url.include?("q%5Bs%5D=organization+asc"), "filter not retained"
2020
end
2121

2222
test "after filtering index, should retain filter on edit and back with button" do
@@ -25,7 +25,7 @@ def teardown
2525
find_link("Organization").click
2626
find_link("Nintendo").click
2727
first(".button.-cancel").click
28-
assert page.current_url.include?("q[s]=organization+asc"), "filter should be retained"
28+
assert page.current_url.include?("q%5Bs%5D=organization+asc"), "filter should be retained"
2929
end
3030

3131
test "after filtering index, should retain filter on edit and save" do
@@ -34,7 +34,7 @@ def teardown
3434
find_link("Organization").click
3535
find_link("Nintendo").click
3636
first(".button.-save").click
37-
assert page.current_url.include?("q[s]=organization+asc"), "filter not retained"
37+
assert page.current_url.include?("q%5Bs%5D=organization+asc"), "filter not retained"
3838
end
3939

4040
test "after filtering index, should retain filter on edit and failed validation" do
@@ -45,7 +45,7 @@ def teardown
4545
fill_in("administrator[email]", with:"")
4646
first(".button.-save").click
4747
first(".button.-cancel").click
48-
assert page.current_url.include?("q[s]=organization+asc"), "filter retained"
48+
assert page.current_url.include?("q%5Bs%5D=organization+asc"), "filter retained"
4949
end
5050

5151
test "after filtering index, should NOT retain filter on save and review" do
@@ -54,7 +54,7 @@ def teardown
5454
find_link("Organization").click
5555
find_link("Nintendo").click
5656
first(".button.-save-and-review").click
57-
assert page.current_url.exclude?("q[s]=organization+asc"), "filter not retained"
57+
assert page.current_url.exclude?("q%5Bs%5D=organization+asc"), "filter not retained"
5858
end
5959

6060
end

test/integration/session_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ def assert_failed_authentication!
3333

3434
test "admin form fields should be empty" do
3535
visit "/admin/signin"
36-
assert_equal nil, find("#session-form-email").value()
37-
assert_equal nil, find("#session-form-passcode", visible:false).value()
36+
assert_nil find("#session-form-email").value
37+
assert_nil find("#session-form-passcode", visible: false).value
3838
end
3939

4040
test "session form doesn't explode when junk submitted" do

test/unit/menu_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class MenuTest < ActiveSupport::TestCase
99
test "menu categories supersede class categories" do
1010
old_setting = Tolaria.config.menu_categories
1111
Tolaria.config.menu_categories = ["Bull", "Krem"]
12-
assert_equal ["Bull", "Krem", "Settings", "Prose", "Media"], Tolaria.categories
12+
assert_equal ["Bull", "Krem", "Settings", "Media", "Prose"], Tolaria.categories
1313
Tolaria.config.menu_categories = old_setting
1414
end
1515

tolaria.gemspec

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,18 @@ Gem::Specification.new do |s|
1717
s.test_files = `git ls-files --directory test`.split("\n")
1818
s.require_paths = ["lib"]
1919

20-
s.required_ruby_version = ">= 2.3"
20+
21+
s.required_ruby_version = ">= 2.6"
2122

2223
s.add_dependency "bcrypt", "~> 3.1"
23-
s.add_dependency "kaminari", "~> 0.16"
24-
s.add_dependency "rails", "~> 5.0"
25-
s.add_dependency "ransack", "~> 1.8"
26-
s.add_dependency "sass-rails", "~> 5.0"
24+
s.add_dependency "kaminari", "~> 1.1.1"
25+
s.add_dependency "rails", "~> 6.0.0"
26+
s.add_dependency "ransack", "~> 2.3"
27+
s.add_dependency "sass-rails", "~> 6.0"
2728
s.add_dependency "sass", "~> 3.0"
2829

29-
s.add_development_dependency "capybara", "~> 2.4"
30-
s.add_development_dependency "minitest", "~> 5.7"
30+
s.add_development_dependency "capybara", "~> 3.28"
31+
s.add_development_dependency "minitest", "~> 5.11"
3132
s.add_development_dependency "redcarpet", "~> 3"
3233
s.add_development_dependency "sqlite3", "~> 1.3"
3334
s.add_development_dependency "timecop", "~> 0.7"

0 commit comments

Comments
 (0)