This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
casaschool/src/casaschool master ✗ 7h22m ⚑ ◒ | |
▶ rails c | |
Loading development environment (Rails 4.2.5.1) | |
[1] pry(main)> group2 = Group.new | |
=> #<Group:0x007fb386d8c188 id: nil, slug: nil, description: nil, created_at: nil, updated_at: nil, email: nil, position: 0, page_id: nil, section_id: nil, parent: nil> | |
[2] pry(main)> group2.name = 'name' | |
=> "name" | |
[3] pry(main)> group2.save! | |
(0.4ms) BEGIN | |
(0.3ms) ROLLBACK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en" class=""> | |
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# object: http://ogp.me/ns/object# article: http://ogp.me/ns/article# profile: http://ogp.me/ns/profile#"> | |
<meta charset='utf-8'> | |
<link crossorigin="anonymous" href="https://assets-cdn.github.com/assets/github-6603a12316e50e603e0b44558adf7a5eb8cac166d102d798149c5553098a41c1.css" media="all" rel="stylesheet" /> | |
<link crossorigin="anonymous" href="https://assets-cdn.github.com/assets/github2-a87cd6dd740cc44b59219652052d8b935af35c8063ec31afbd38fb52cc526468.css" media="all" rel="stylesheet" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en" class=""> | |
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# object: http://ogp.me/ns/object# article: http://ogp.me/ns/article# profile: http://ogp.me/ns/profile#"> | |
<meta charset='utf-8'> | |
<link crossorigin="anonymous" href="https://assets-cdn.github.com/assets/github-6603a12316e50e603e0b44558adf7a5eb8cac166d102d798149c5553098a41c1.css" media="all" rel="stylesheet" /> | |
<link crossorigin="anonymous" href="https://assets-cdn.github.com/assets/github2-a87cd6dd740cc44b59219652052d8b935af35c8063ec31afbd38fb52cc526468.css" media="all" rel="stylesheet" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Tasks | |
All open source gems, repos and internets are at your disposal for the excersise. | |
You have to use Ruby (1.9 or higher) and Rails (3.2 or higher) but all the remaining | |
technology decisions are yours. Good luck! | |
## 1) CRUD | |
Make a web application to manage a TODO list. Every (TODO) Item is just a piece of text that | |
is either `opened` or `closed`. The user has to be able to create an item, update an item | |
and list all of them. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Data | |
class << self | |
def all | |
(1..10).to_a | |
end | |
def created | |
[4, 5, 6, 8, 9] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# put in config/application.rb | |
config.to_prepare do | |
::PagesController.module_eval do | |
caches_page :show, :unless => proc {|c| c.user_signed_in? || c.flash.any? } | |
caches_page :home, :unless => proc {|c| c.user_signed_in? || c.flash.any? } | |
end | |
::Page.module_eval do | |
after_save :clear_static_caching! | |
after_destroy :clear_static_caching! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# put in config/application.rb | |
config.to_prepare do | |
::PagesController.module_eval do | |
caches_page :show, :unless => proc {|c| c.user_signed_in? || c.flash.any? } | |
caches_page :home, :unless => proc {|c| c.user_signed_in? || c.flash.any? } | |
end | |
::Page.module_eval do | |
after_save :clear_static_caching! | |
after_destroy :clear_static_caching! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Page::Translation Load (0.3ms) SELECT "page_translations".* FROM "page_translations" WHERE "page_translations"."locale" IN ('en') AND ("page_translations".page_id = NULL) | |
CACHE (0.0ms) SELECT "page_translations".* FROM "page_translations" WHERE "page_translations"."locale" IN ('en') AND ("page_translations".page_id = NULL) | |
CACHE (0.0ms) SELECT "page_translations".* FROM "page_translations" WHERE "page_translations"."locale" IN ('en') AND ("page_translations".page_id = NULL) | |
CACHE (0.0ms) SELECT "page_translations".* FROM "page_translations" WHERE "page_translations"."locale" IN ('en') AND ("page_translations".page_id = NULL) | |
CACHE (0.0ms) SELECT "page_translations".* FROM "page_translations" WHERE "page_translations"."locale" IN ('en') AND ("page_translations".page_id = NULL) | |
CACHE (0.0ms) SELECT "page_translations".* FROM "page_translations" WHERE "page_translations"."locale" IN ('en') AND ("page_translations".page_id = NULL) | |
CACHE (0.0ms) SELECT "page_translations".* FROM "page_translatio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/Users/thomasmaas/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/syck/rubytypes.rb:6:in `to_yaml' | |
activerecord (3.0.4) lib/active_record/connection_adapters/abstract/quoting.rb:34:in `quote' | |
friendly_id_globalize3 (3.2.0) lib/friendly_id/active_record_adapter/relation.rb:104:in `block in sluggable_ids_for' | |
friendly_id_globalize3 (3.2.0) lib/friendly_id/active_record_adapter/relation.rb:102:in `each' | |
friendly_id_globalize3 (3.2.0) lib/friendly_id/active_record_adapter/relation.rb:102:in `inject' | |
friendly_id_globalize3 (3.2.0) lib/friendly_id/active_record_adapter/relation.rb:102:in `sluggable_ids_for' | |
friendly_id_globalize3 (3.2.0) lib/friendly_id/active_record_adapter/relation.rb:62:in `find_one_with_slug' | |
friendly_id_globalize3 (3.2.0) lib/friendly_id/active_record_adapter/relation.rb:25:in `find_one' | |
friendly_id_globalize3 (3.2.0) lib/friendly_id/active_record_adapter/relation.rb:150:in `find_one' | |
activerecord (3.0.4) lib/active_record/relation/finder_methods.rb:281:in `find_with_ids' |