query calibre

This commit is contained in:
Meutel 2015-06-28 13:58:53 +02:00
parent 99d802dd88
commit 50ece28ab6
7 changed files with 16 additions and 1 deletions

1
.gitignore vendored
View File

@ -19,3 +19,4 @@
*~
*.*.swp
/vendor/ruby

View File

@ -70,9 +70,11 @@ GEM
mail (2.6.3)
mime-types (>= 1.16, < 3)
mime-types (2.6.1)
mini_portile (0.6.2)
minitest (5.7.0)
multi_json (1.11.1)
nokogiri (1.6.6.2)
mini_portile (~> 0.6.0)
rack (1.6.4)
rack-test (0.6.3)
rack (>= 1.0)

View File

@ -1,6 +1,7 @@
class StaticPagesController < ApplicationController
def home
@title = "Home"
@books_count = Calibre::Book.count
end
def about

2
app/models/book.rb Normal file
View File

@ -0,0 +1,2 @@
class Book < ActiveRecord::Base
end

View File

@ -1,2 +1,2 @@
<h1>Welcome</h1>
<p>Coming soon, an e-book library</p>
<p><%= @books_count %> books in library</p>

View File

@ -4,6 +4,8 @@ require File.expand_path('../application', __FILE__)
# Initialize the Rails application.
Rails.application.initialize!
ENV['GEM_PATH']='/home/meutel/gems/:/usr/local/lib/ruby/gems/2.1/'
ENV['GEM_HOME']='/home/meutel/gems'
require 'magic_multi_connections'
module Calibre

7
test/models/book_test.rb Normal file
View File

@ -0,0 +1,7 @@
require 'test_helper'
class BookTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end