Follow the steps below to setup a local development environment:
Recommended to download latest XQuartz
user web; | |
# One worker process per CPU core. | |
worker_processes 8; | |
# Also set | |
# /etc/security/limits.conf | |
# web soft nofile 65535 | |
# web hard nofile 65535 | |
# /etc/default/nginx |
See question on stack overflow: http://stackoverflow.com/questions/28595636/rails-4-how-to-give-alias-names-to-includes-and-joins-in-active-record-que | |
- Model Student and model Teacher are both STI models with super class model User | |
- Model Story is a STI model with super class model Task | |
- includes() and joins(), both fails | |
Rails alias naming convention (includes() and joins()) | |
- One model as parameter | |
- is base model (includes(:users)) |
Follow the steps below to setup a local development environment:
Recommended to download latest XQuartz
This is a collection of information on PostgreSQL and PostGIS for what I tend to use most often.
#!/bin/ruby --verion => 2.0.0-p353
In Ruby, self is a special variable that always references the current object.
# A user session class, a simplified mix of the following code samples: | |
# * https://github.com/blog/1661-modeling-your-app-s-user-session | |
# * http://www.jonathanleighton.com/articles/2013/revocable-sessions-with-devise/ | |
class Session < ActiveRecord::Base | |
# Uncomment if you use Hobo Fields, else add these yourself | |
# fields do | |
# session_id :string, :index => true, :unique => true | |
# accessed_at :datetime | |
# user_ip :string |
For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.
Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon
with HyperThreading enabled, but it can work without problem on slower machines.
You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.
#!/bin/bash | |
# Function displaying wrong usage information | |
# Proper usage is: ./dev_start.sh Rails-Project-Folder | |
usage() | |
{ | |
cat << EOF | |
usage: $0 Rails-Project-Folder | |
EOF | |
} |
@import "dataTables/jquery.dataTables"; | |
/* A modifier pour avoir les bons espacements */ | |
body.active_admin .data_table { | |
padding-bottom: 10px; | |
} | |
body.active_admin .dataTables_paginate { | |
margin-top: -10px; |