Skip to content

Instantly share code, notes, and snippets.

View GustavoCaso's full-sized avatar
🧩

Gustavo Caso GustavoCaso

🧩
View GitHub Profile
@GustavoCaso
GustavoCaso / gist:04814ca143e365c5cee2
Last active August 29, 2015 14:22
View Bechmark for JobAndTalent

#Loading Login Page without Any Library Google Chrome Network ###Rails Logs

Completed 200 OK in 27.0ms (Views: 22.6ms | ActiveRecord: 0.0ms)
Completed 200 OK in 35.1ms (Views: 29.0ms | ActiveRecord: 0.0ms)
Completed 200 OK in 25.6ms (Views: 21.3ms | ActiveRecord: 0.0ms)

Loading with Libraries

Google Chrome Network

Write a model (ActiveRecord-based) for storing global configuration settings. It will be used for storing single values, for example an email address to send error emails to, or a flag enable/disable a particular feature. The interface must be simple and convenient, it should be possible to read and write specific configuration items. It must be possible to store values of these 4 types: string, integer, float and boolean. The model should come with a unit test and a migration.
Bonus: add caching within the model so that values are cached in regular Rails cache to minimize db load.
Please include a quick summary of use and commentary regarding any design decisions. Please indicate how long you spent working on this.
@GustavoCaso
GustavoCaso / reviews_controller_spec.rb
Created July 3, 2014 08:03
Error with shared examples rspec, always return undefined method id for nil class
require 'spec_helper'
describe ReviewsController do
before(:each) do
signin_user
@video = Fabricate(:video)
end
describe 'Post Create' do
context 'Authenticated user Valid data' do
it 'create a new review with valid data' do
@GustavoCaso
GustavoCaso / gist:bbc71c3eda42d52d38f3
Created May 12, 2014 18:53
Tealeaf Rails Rapid Prototyping with Ruby on Rails - Lesson 1 Quiz
1. The data is store in table which have an unique identifier, usually call primary id,
also it is posible to create relathionship between tables through this primary key.
2. SQL(Structured Query Language) is the language to acces the tables in our databases to
insert, extract, delete or update.
3. There are Data and Schema, schema is a way to represent the different tables in our DataBase
what type of data and the name of the columns. And Data show the data, inside the tables,
every Database has it own schema.
4. Primary Key
5. A foreign Key is an identifier inside of a table that refers to another table.
6. ActiveRecord connects the rich objects of an application to tables in a relational database management.