Skip to content
This repository has been archived by the owner on Jan 10, 2021. It is now read-only.

Commit

Permalink
app release
Browse files Browse the repository at this point in the history
  • Loading branch information
cntoplolicon committed Nov 2, 2015
1 parent 9cf9e33 commit 11608e1
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
9 changes: 9 additions & 0 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,12 @@ def success
get '/' do
send_file File.join(settings.public_folder, 'index.html')
end

get '/app_release' do
@app_release = AppRelease.first
if @app_release
json @app_release
else
json version_code: 0
end
end
11 changes: 11 additions & 0 deletions db/migrate/20151102024703_create_app_releases2.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class CreateAppReleases2 < ActiveRecord::Migration
def change
create_table :app_releases do |t|
t.integer :version_code
t.text :message
t.string :download_url
t.timestamps null: false
end
add_index :app_releases, :version_code, unique: true
end
end
12 changes: 11 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,17 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20151031054337) do
ActiveRecord::Schema.define(version: 20151102024703) do

create_table "app_releases", force: :cascade do |t|
t.integer "version_code", limit: 4
t.text "message", limit: 65535
t.string "download_url", limit: 255
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

add_index "app_releases", ["version_code"], name: "index_app_releases_on_version_code", unique: true, using: :btree

create_table "bookmarks", force: :cascade do |t|
t.integer "user_id", limit: 4, null: false
Expand Down

0 comments on commit 11608e1

Please sign in to comment.