SlideShare una empresa de Scribd logo
1 de 24
Descargar para leer sin conexión
POSTGRESQL & ROR

Tuesday, January 15, 13
SPEED   ...




Tuesday, January 15, 13
SPEED (OR LACK OF)




Tuesday, January 15, 13
SPEED (OR LACK OF)



                          90
         seconds
        for a page
Tuesday, January 15, 13
#1 LOCATION



                          112 000
                           locations




Tuesday, January 15, 13
#1 LOCATION




Tuesday, January 15, 13
select    row_to_json             (location)
                            from
                              (select id, ancestry, name, coordinates from locations)
                               as location
              {"id":23727,"ancestry":"214/217/22888","name":"Olho d'Água do Piauí","coordinates":"POINT (-42.53937 -5.84854)"}
              {"id":69289,"ancestry":"74/115/68153","name":"la Sentiu de Sió","coordinates":"POINT (0.86948 41.79807)"}




Tuesday, January 15, 13
select  array_to_json                (array_agg(location))
                             from
                               (select id, ancestry, name, coordinates from locations)
                                as location
                    [{"id":23727,"ancestry":"214/217/22888","name":"Olho d'Água do Piauí",
                    "coordinates":"POINT (-42.53937 -5.84854)"}, {"id"69289,"ancestry":"74/115/68153",
                    "name":"la Sentiu de Sió","coordinates":"POINT (0.86948 41.79807)"}]




Tuesday, January 15, 13
Tuesday, January 15, 13
Location.where('ancestry_depth < 3').
                                 select('id, ancestry, name, coordinates').all.
                                 inject({}) do |memo, record|
                                  memo[record.ancestry] << record
                                  memo
                                 end

                          { nil => [ <Location name=‘Europe’, id: 5 ...>, ... ],
                            “5” => [ <Location name=‘Poland’, id: 245>, ...],
                            ... }




Tuesday, January 15, 13
nodes[nil].collect { |location| prepare_node(location) }

            def prepare_node(location)
             node(location).
               merge(prepare_children(nodes[node_key_for_children(location)]))
            end

            def node(location)
             location.to_node_data
            end

            def prepare_children(children)
             { children: children.collect do |location|
                prepare_node(location)
               end
             }
            end

Tuesday, January 15, 13
to_json


Tuesday, January 15, 13
Oj.dump
                          to_json

Tuesday, January 15, 13
to_json   Oj      PostgreSQL


                   3000



                   2250



                   1500



                      750



                          0
                                         2314




Tuesday, January 15, 13
#1 LOCATION




Tuesday, January 15, 13
query: China

                          => <Location id: 9, name: “China”,
                               ancestry: “1” ... >
                          => ...
                          => <Location id: 26727, name: “Chinavita”,
                               ancestry: “214/228/26242” ... >




Tuesday, January 15, 13
query: China

                          => <Location id:    9, name: “China”,
                                   ancestry: “1” ... >
                          => ...
                          => <Location id:    26727, name: “Chinavita”,
                                   ancestry: “214/228/26242” ... >




Tuesday, January 15, 13
CREATE OR REPLACE FUNCTION find_locations_with_ancestors(text, boolean)
               RETURNS int[] AS
              $$
              DECLARE
               search_result_ids int[];
               all_ids int[];
               pattern text;
              BEGIN
               pattern := '^('||$1||')|[ |,]('||$1||')';
               FOR search_result_ids IN (
                      select (locations.id || string_to_array(locations.ancestry, '/')::int[]) as ids
                         from locations
                      where
                         (locations.name ~* pattern or locations.code ~* pattern or locations.alternative_name ~* pattern)
                         and (not($2) or locations.coordinates = ''
                         or locations.coordinates is null)
                   ) LOOP
                 all_ids := all_ids || search_result_ids;
               END LOOP;
               RETURN all_ids;
              END;
              $$
              LANGUAGE plpgsql;

Tuesday, January 15, 13
scope :find_with_ancestors, ->(query, only_without_coordinates) do
                       where('array[locations.id] <@
                         (select * from find_locations_with_ancestors(?, ?))',
                         query, only_without_coordinates)
                      end




Tuesday, January 15, 13
find_locations_with_ancestors = (quary::text, without_cordinates::boolean) ->
                           declare:
                             record_location_ids::int[]
                             ids::int[]
                            begin:

                             FOR record_location_ids IN
                               :ruby-
                                 pattern = /^('||$1||')|[ |,]('||$1||')/
                               :ruby=
                                 Location.where{
                                   { name: pattern, code: pattern, alternative_name: pattern }.sql_or,
                                   ‘(not($2) or locations.coordinates = '' or locations.coordinates is null)’
                                 }.select{
                                   id || string_to_array(ancestry, ‘/’)::int[]) as ids
                                 }.to_sql
                               ) LOOP
                                  all_ids := all_ids || search_result_ids
                              END LOOP
                             RETURN all_ids




Tuesday, January 15, 13
Tuesday, January 15, 13
RAILS 4 :-)


                                  hstore

                                  array (int, string)

                                  ranges (date, time, int) [?]




Tuesday, January 15, 13
Tuesday, January 15, 13
PICTURES SOURCE


                 http://xanthe93.deviantart.com/art/Steampunk-Elephant-Train-
                 Lineart-290163415

                 http://www.businessinsider.com/fastest-trains-in-the-world-2011-11?op=1

                 http://www.fortogden.com/goldenspike.html

                 http://noweevil.com/portfolio/wednesday-morning-wakeup-call-20-photos/

                 http://www.softicons.com/free-icons/application-icons/ruby-programming-
                 icons-by-ahmad-galal/ruby-on-rails-icon




Tuesday, January 15, 13

Más contenido relacionado

La actualidad más candente

Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Masahiro Nagano
 
DrupalCamp Foz - Novas APIs Drupal 7
DrupalCamp Foz - Novas APIs Drupal 7DrupalCamp Foz - Novas APIs Drupal 7
DrupalCamp Foz - Novas APIs Drupal 7
chuvainc
 
Introduction à CoffeeScript pour ParisRB
Introduction à CoffeeScript pour ParisRB Introduction à CoffeeScript pour ParisRB
Introduction à CoffeeScript pour ParisRB
jhchabran
 
Implementation Specifications
Implementation SpecificationsImplementation Specifications
Implementation Specifications
Unmon Mukherjee
 

La actualidad más candente (20)

Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
 
DrupalCamp Foz - Novas APIs Drupal 7
DrupalCamp Foz - Novas APIs Drupal 7DrupalCamp Foz - Novas APIs Drupal 7
DrupalCamp Foz - Novas APIs Drupal 7
 
PHP Static Code Review
PHP Static Code ReviewPHP Static Code Review
PHP Static Code Review
 
Fact, Fiction, and FP
Fact, Fiction, and FPFact, Fiction, and FP
Fact, Fiction, and FP
 
Introduction à CoffeeScript pour ParisRB
Introduction à CoffeeScript pour ParisRB Introduction à CoffeeScript pour ParisRB
Introduction à CoffeeScript pour ParisRB
 
Dependency Injection
Dependency InjectionDependency Injection
Dependency Injection
 
Lenses
LensesLenses
Lenses
 
Using Templates to Achieve Awesomer Architecture
Using Templates to Achieve Awesomer ArchitectureUsing Templates to Achieve Awesomer Architecture
Using Templates to Achieve Awesomer Architecture
 
PhoneGap: Local Storage
PhoneGap: Local StoragePhoneGap: Local Storage
PhoneGap: Local Storage
 
Drush. Secrets come out.
Drush. Secrets come out.Drush. Secrets come out.
Drush. Secrets come out.
 
Command-Oriented Architecture
Command-Oriented ArchitectureCommand-Oriented Architecture
Command-Oriented Architecture
 
앱스프레소를 이용한 모바일 앱 개발(2)
앱스프레소를 이용한 모바일 앱 개발(2)앱스프레소를 이용한 모바일 앱 개발(2)
앱스프레소를 이용한 모바일 앱 개발(2)
 
Ricky Bobby's World
Ricky Bobby's WorldRicky Bobby's World
Ricky Bobby's World
 
CakeFest 2013 keynote
CakeFest 2013 keynoteCakeFest 2013 keynote
CakeFest 2013 keynote
 
Implementation Specifications
Implementation SpecificationsImplementation Specifications
Implementation Specifications
 
Presentation1
Presentation1Presentation1
Presentation1
 
Bash and regular expressions
Bash and regular expressionsBash and regular expressions
Bash and regular expressions
 
画像Hacks
画像Hacks画像Hacks
画像Hacks
 
Drupal csu-open atriumname
Drupal csu-open atriumnameDrupal csu-open atriumname
Drupal csu-open atriumname
 
Coding website
Coding websiteCoding website
Coding website
 

Destacado

Unit-Testing Bad-Practices by Example
Unit-Testing Bad-Practices by ExampleUnit-Testing Bad-Practices by Example
Unit-Testing Bad-Practices by Example
Benjamin Eberlei
 
Types of Software Testing
Types of Software TestingTypes of Software Testing
Types of Software Testing
Nishant Worah
 
Testing concepts ppt
Testing concepts pptTesting concepts ppt
Testing concepts ppt
Rathna Priya
 
Agile Testing Process
Agile Testing ProcessAgile Testing Process
Agile Testing Process
Intetics
 
Software Testing Fundamentals
Software Testing FundamentalsSoftware Testing Fundamentals
Software Testing Fundamentals
Chankey Pathak
 

Destacado (20)

Unittesting Bad-Practices by Example
Unittesting Bad-Practices by ExampleUnittesting Bad-Practices by Example
Unittesting Bad-Practices by Example
 
User Testing by Example
User Testing by ExampleUser Testing by Example
User Testing by Example
 
Domino testing presentation
Domino testing presentationDomino testing presentation
Domino testing presentation
 
Bad test, good test
Bad test, good testBad test, good test
Bad test, good test
 
Specification by Example
Specification by ExampleSpecification by Example
Specification by Example
 
Unit-Testing Bad-Practices by Example
Unit-Testing Bad-Practices by ExampleUnit-Testing Bad-Practices by Example
Unit-Testing Bad-Practices by Example
 
Testing
TestingTesting
Testing
 
Specifications For Enterprise Testing
Specifications For Enterprise TestingSpecifications For Enterprise Testing
Specifications For Enterprise Testing
 
7 1-1 soap-developers_guide
7 1-1 soap-developers_guide7 1-1 soap-developers_guide
7 1-1 soap-developers_guide
 
Don't Drop the SOAP: Real World Web Service Testing for Web Hackers
Don't Drop the SOAP: Real World Web Service Testing for Web Hackers Don't Drop the SOAP: Real World Web Service Testing for Web Hackers
Don't Drop the SOAP: Real World Web Service Testing for Web Hackers
 
Moving Towards Zero Defects with Specification by Example
Moving Towards Zero Defects with Specification by ExampleMoving Towards Zero Defects with Specification by Example
Moving Towards Zero Defects with Specification by Example
 
Learn SoapUI
Learn SoapUILearn SoapUI
Learn SoapUI
 
Agile Testing by Example
Agile Testing by ExampleAgile Testing by Example
Agile Testing by Example
 
Manual testing ppt
Manual testing pptManual testing ppt
Manual testing ppt
 
Types of Software Testing
Types of Software TestingTypes of Software Testing
Types of Software Testing
 
Testing concepts ppt
Testing concepts pptTesting concepts ppt
Testing concepts ppt
 
Introduction to Agile software testing
Introduction to Agile software testingIntroduction to Agile software testing
Introduction to Agile software testing
 
Agile Testing Process
Agile Testing ProcessAgile Testing Process
Agile Testing Process
 
Software Testing Fundamentals
Software Testing FundamentalsSoftware Testing Fundamentals
Software Testing Fundamentals
 
The Minimum Loveable Product
The Minimum Loveable ProductThe Minimum Loveable Product
The Minimum Loveable Product
 

Similar a Postgresql and ror

Cypher inside out: Como a linguagem de pesquisas em grafo do Neo4j foi constr...
Cypher inside out: Como a linguagem de pesquisas em grafo do Neo4j foi constr...Cypher inside out: Como a linguagem de pesquisas em grafo do Neo4j foi constr...
Cypher inside out: Como a linguagem de pesquisas em grafo do Neo4j foi constr...
adrianoalmeida7
 
Beautiful PHP CLI Scripts
Beautiful PHP CLI ScriptsBeautiful PHP CLI Scripts
Beautiful PHP CLI Scripts
Jesse Donat
 
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at StripeBuilding Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
MongoDB
 

Similar a Postgresql and ror (18)

CoffeeScript
CoffeeScriptCoffeeScript
CoffeeScript
 
Perl6 a whistle stop tour
Perl6 a whistle stop tourPerl6 a whistle stop tour
Perl6 a whistle stop tour
 
Perl6 a whistle stop tour
Perl6 a whistle stop tourPerl6 a whistle stop tour
Perl6 a whistle stop tour
 
How to write code you won't hate tomorrow
How to write code you won't hate tomorrowHow to write code you won't hate tomorrow
How to write code you won't hate tomorrow
 
Pre-Bootcamp introduction to Elixir
Pre-Bootcamp introduction to ElixirPre-Bootcamp introduction to Elixir
Pre-Bootcamp introduction to Elixir
 
Parsing with Perl6 Grammars
Parsing with Perl6 GrammarsParsing with Perl6 Grammars
Parsing with Perl6 Grammars
 
Modern Perl
Modern PerlModern Perl
Modern Perl
 
Cypher inside out: Como a linguagem de pesquisas em grafo do Neo4j foi constr...
Cypher inside out: Como a linguagem de pesquisas em grafo do Neo4j foi constr...Cypher inside out: Como a linguagem de pesquisas em grafo do Neo4j foi constr...
Cypher inside out: Como a linguagem de pesquisas em grafo do Neo4j foi constr...
 
C arrays
C arraysC arrays
C arrays
 
Programação Funcional
Programação FuncionalProgramação Funcional
Programação Funcional
 
Slaying the Dragon: Implementing a Programming Language in Ruby
Slaying the Dragon: Implementing a Programming Language in RubySlaying the Dragon: Implementing a Programming Language in Ruby
Slaying the Dragon: Implementing a Programming Language in Ruby
 
Beautiful PHP CLI Scripts
Beautiful PHP CLI ScriptsBeautiful PHP CLI Scripts
Beautiful PHP CLI Scripts
 
Fluent14
Fluent14Fluent14
Fluent14
 
Groovy
GroovyGroovy
Groovy
 
DBI
DBIDBI
DBI
 
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at StripeBuilding Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
 
Ns2programs
Ns2programsNs2programs
Ns2programs
 
Taking Inspiration From The Functional World
Taking Inspiration From The Functional WorldTaking Inspiration From The Functional World
Taking Inspiration From The Functional World
 

Último

Último (20)

Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

Postgresql and ror

  • 1. POSTGRESQL & ROR Tuesday, January 15, 13
  • 2. SPEED ... Tuesday, January 15, 13
  • 3. SPEED (OR LACK OF) Tuesday, January 15, 13
  • 4. SPEED (OR LACK OF) 90 seconds for a page Tuesday, January 15, 13
  • 5. #1 LOCATION 112 000 locations Tuesday, January 15, 13
  • 7. select row_to_json (location) from (select id, ancestry, name, coordinates from locations) as location {"id":23727,"ancestry":"214/217/22888","name":"Olho d'Água do Piauí","coordinates":"POINT (-42.53937 -5.84854)"} {"id":69289,"ancestry":"74/115/68153","name":"la Sentiu de Sió","coordinates":"POINT (0.86948 41.79807)"} Tuesday, January 15, 13
  • 8. select array_to_json (array_agg(location)) from (select id, ancestry, name, coordinates from locations) as location [{"id":23727,"ancestry":"214/217/22888","name":"Olho d'Água do Piauí", "coordinates":"POINT (-42.53937 -5.84854)"}, {"id"69289,"ancestry":"74/115/68153", "name":"la Sentiu de Sió","coordinates":"POINT (0.86948 41.79807)"}] Tuesday, January 15, 13
  • 10. Location.where('ancestry_depth < 3'). select('id, ancestry, name, coordinates').all. inject({}) do |memo, record| memo[record.ancestry] << record memo end { nil => [ <Location name=‘Europe’, id: 5 ...>, ... ], “5” => [ <Location name=‘Poland’, id: 245>, ...], ... } Tuesday, January 15, 13
  • 11. nodes[nil].collect { |location| prepare_node(location) } def prepare_node(location) node(location). merge(prepare_children(nodes[node_key_for_children(location)])) end def node(location) location.to_node_data end def prepare_children(children) { children: children.collect do |location| prepare_node(location) end } end Tuesday, January 15, 13
  • 13. Oj.dump to_json Tuesday, January 15, 13
  • 14. to_json Oj PostgreSQL 3000 2250 1500 750 0 2314 Tuesday, January 15, 13
  • 16. query: China => <Location id: 9, name: “China”, ancestry: “1” ... > => ... => <Location id: 26727, name: “Chinavita”, ancestry: “214/228/26242” ... > Tuesday, January 15, 13
  • 17. query: China => <Location id: 9, name: “China”, ancestry: “1” ... > => ... => <Location id: 26727, name: “Chinavita”, ancestry: “214/228/26242” ... > Tuesday, January 15, 13
  • 18. CREATE OR REPLACE FUNCTION find_locations_with_ancestors(text, boolean) RETURNS int[] AS $$ DECLARE search_result_ids int[]; all_ids int[]; pattern text; BEGIN pattern := '^('||$1||')|[ |,]('||$1||')'; FOR search_result_ids IN ( select (locations.id || string_to_array(locations.ancestry, '/')::int[]) as ids from locations where (locations.name ~* pattern or locations.code ~* pattern or locations.alternative_name ~* pattern) and (not($2) or locations.coordinates = '' or locations.coordinates is null) ) LOOP all_ids := all_ids || search_result_ids; END LOOP; RETURN all_ids; END; $$ LANGUAGE plpgsql; Tuesday, January 15, 13
  • 19. scope :find_with_ancestors, ->(query, only_without_coordinates) do where('array[locations.id] <@ (select * from find_locations_with_ancestors(?, ?))', query, only_without_coordinates) end Tuesday, January 15, 13
  • 20. find_locations_with_ancestors = (quary::text, without_cordinates::boolean) -> declare: record_location_ids::int[] ids::int[] begin: FOR record_location_ids IN :ruby- pattern = /^('||$1||')|[ |,]('||$1||')/ :ruby= Location.where{ { name: pattern, code: pattern, alternative_name: pattern }.sql_or, ‘(not($2) or locations.coordinates = '' or locations.coordinates is null)’ }.select{ id || string_to_array(ancestry, ‘/’)::int[]) as ids }.to_sql ) LOOP all_ids := all_ids || search_result_ids END LOOP RETURN all_ids Tuesday, January 15, 13
  • 22. RAILS 4 :-) hstore array (int, string) ranges (date, time, int) [?] Tuesday, January 15, 13
  • 24. PICTURES SOURCE http://xanthe93.deviantart.com/art/Steampunk-Elephant-Train- Lineart-290163415 http://www.businessinsider.com/fastest-trains-in-the-world-2011-11?op=1 http://www.fortogden.com/goldenspike.html http://noweevil.com/portfolio/wednesday-morning-wakeup-call-20-photos/ http://www.softicons.com/free-icons/application-icons/ruby-programming- icons-by-ahmad-galal/ruby-on-rails-icon Tuesday, January 15, 13