Utilisable avec sqlite3
This commit is contained in:
parent
c8edeef4ef
commit
231aeb759c
@ -5,7 +5,8 @@ Ceci est une application permettant de lister des évènements sur un calendier,
|
||||
d'être affichés.
|
||||
|
||||
Cette application est disponible sous la license AGPL version 3 ou supérieure.
|
||||
Elle est hébergée ici: https://gitorious.org/agenda-du-libre-rails
|
||||
Elle est hébergée ici: https://gitorious.org/agenda-du-libre-rails et visible
|
||||
ici: http://agendadulibre.org
|
||||
|
||||
La technologie repose sur "Ruby on Rails", version 4 ou supérieure.
|
||||
|
||||
@ -25,13 +26,14 @@ Par exemple:
|
||||
~ $ bundle install --path vendor/bundle
|
||||
}}}
|
||||
|
||||
La base de données peut être "sqlite3", "postgresql" ou "mysql". Vous devrez la
|
||||
configurer par le fichier `config/database.yml`.
|
||||
La base de données peut être "sqlite3", "postgresql" ou "mysql". Par défaut
|
||||
sqlite3 est configurée, mais vous pouvez la modifier dans le fichier
|
||||
`config/database.yml`.
|
||||
|
||||
Sous un environnement comme debian, il faut aussi les paquets "build-essential"
|
||||
et "libmysqlclient-dev".
|
||||
et "libsqlite3-dev" (ou "libmysqlclient-dev").
|
||||
|
||||
Une fois configurée, mettez en place le schéma comme ceci:
|
||||
Mettez en place le schéma comme ceci:
|
||||
{{{
|
||||
~ $ rake db:setup
|
||||
}}}
|
||||
|
@ -23,5 +23,8 @@ ActiveAdmin.register_page 'Dashboard' do
|
||||
end
|
||||
end
|
||||
end
|
||||
panel "ActiveAdmin" do
|
||||
para %(Currently deployed: #{`git describe --tags --abbrev=0`}, #{link_to(`git rev-parse --short HEAD`, "https://github.com/gregbell/active_admin/commit/#{`git rev-parse HEAD`}")}).html_safe
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -12,10 +12,10 @@ class Event < ActiveRecord::Base
|
||||
|
||||
|
||||
scope :moderated, -> { where moderated: true }
|
||||
scope :past, -> { where('end_time < now()').order(start_time: :desc) }
|
||||
scope :future, -> { where('end_time >= now()').order(start_time: :asc) }
|
||||
scope :past, -> { where('end_time < ?', Date.today).order(start_time: :desc) }
|
||||
scope :future, -> { where('end_time >= ?', Date.today).order(start_time: :asc) }
|
||||
scope :future_30, -> {
|
||||
where('start_time >= now() and end_time <= ?', Date.today + 30)
|
||||
where('start_time >= ? and end_time <= ?', Date.today, Date.today + 30)
|
||||
.order :start_time
|
||||
}
|
||||
scope :year, -> year {
|
||||
|
@ -2,7 +2,7 @@
|
||||
%em.city= @event.city
|
||||
= @event.title
|
||||
|
||||
- if @event.persisted? && request.format == 'text/html' && controller.controller_name != 'moderations' && controller.controller_name != 'notes' && controller.action_name != 'edit' && controller.action_name != 'cancel'
|
||||
- if @event.persisted? && request.format == 'text/html' && controller.controller_name == 'events' && controller.action_name == 'show'
|
||||
%sidebar#lug-list
|
||||
%h1=t '.lug-list'
|
||||
- if @event.related_region
|
||||
|
@ -8,13 +8,10 @@ development:
|
||||
# re-generated from your development database when you run "rake".
|
||||
# Do not set this db to the same as development or production.
|
||||
test:
|
||||
adapter: mysql2
|
||||
encoding: utf8
|
||||
database: adl_test
|
||||
adapter: sqlite3
|
||||
pool: 5
|
||||
username: manu
|
||||
password:
|
||||
socket: /var/run/mysqld/mysqld.sock
|
||||
timeout: 5000
|
||||
database: db/test.sqlite3
|
||||
|
||||
production:
|
||||
adapter: mysql2
|
||||
|
@ -1,8 +1,12 @@
|
||||
require 'test_helper'
|
||||
|
||||
class UsersControllerTest < ActionController::TestCase
|
||||
include Devise::TestHelpers
|
||||
|
||||
setup do
|
||||
@user = users(:one)
|
||||
|
||||
sign_in users(:one)
|
||||
end
|
||||
|
||||
test "should get index" do
|
||||
|
Loading…
Reference in New Issue
Block a user