spec
|--- apis #do not put into controllers folder.
|--- your_api_test_spec.rb
|--- controllers
|--- models
|--- factories
|--- views
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
# SUPER DARING APP TEMPLATE 1.0 | |
# By Peter Cooper | |
# Link to local copy of edge rails | |
inside('vendor') { run 'ln -s ~/dev/rails/rails rails' } | |
# Delete unnecessary files | |
run "rm README" | |
run "rm public/index.html" | |
run "rm public/favicon.ico" |
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
jmcervera@jmcervera-laptop:~/code/rails3_blog$ rails server | |
^CExiting | |
/usr/lib/ruby/1.8/mongrel/gems.rb:8:in `require': Interrupt | |
from /usr/lib/ruby/1.8/mongrel.rb:16 | |
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0.beta/lib/active_support/dependencies.rb:167:in `require' | |
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0.beta/lib/active_support/dependencies.rb:167:in `require' | |
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0.beta/lib/active_support/dependencies.rb:537:in `new_constants_in' | |
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0.beta/lib/active_support/dependencies.rb:167:in `require' | |
from /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/handler/mongrel.rb:1 | |
from /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/handler.rb:37:in `default' |
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
juanma@juanma45:~/code$ jruby -S rails dm_rails3_app -m http://github.com/snusnu/rails-templates/raw/master/dm_rails_master.rb | |
create | |
create README | |
create .gitignore | |
create Rakefile | |
create config.ru | |
create Gemfile | |
create app | |
create app/helpers/application_helper.rb | |
create app/controllers/application_controller.rb |
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
# rubygems DNS is temporarily down, put this into your /etc/hosts to install gems, | |
# but don't forget to remove the entries once their DNS is back up again | |
72.4.120.124 rubygems.org | |
207.171.181.231 production.s3.rubygems.org | |
216.137.45.24 production.cf.rubygems.org |
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
ODBC::Error: S1090 (0) [unixODBC][Driver Manager]Invalid string or buffer length | |
from /home/jmcervera/.rvm/gems/ruby-1.8.7-p249/bundler/gems/2000-2005-adapter-d3b9c12b533892babd5c39aa1ae62cff0e27caf6-3.0.0.beta1/lib/active_record/connection_adapters/sqlserver_adapter.rb:335:in `initialize' | |
from /home/jmcervera/.rvm/gems/ruby-1.8.7-p249/bundler/gems/2000-2005-adapter-d3b9c12b533892babd5c39aa1ae62cff0e27caf6-3.0.0.beta1/lib/active_record/connection_adapters/sqlserver_adapter.rb:335:in `connect' | |
from /home/jmcervera/.rvm/gems/ruby-1.8.7-p249/bundler/gems/2000-2005-adapter-d3b9c12b533892babd5c39aa1ae62cff0e27caf6-3.0.0.beta1/lib/active_record/connection_adapters/sqlserver_adapter.rb:335:in `connect' | |
from /home/jmcervera/.rvm/gems/ruby-1.8.7-p249/bundler/gems/2000-2005-adapter-d3b9c12b533892babd5c39aa1ae62cff0e27caf6-3.0.0.beta1/lib/active_record/connection_adapters/sqlserver_adapter.rb:186:in `initialize' | |
from /home/jmcervera/.rvm/gems/ruby-1.8.7-p249/bundler/gems/2000-2005-adapter-d3b9c12b533892babd5c39aa1a |
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
SELECT count(*) as TotalRows from (SELECT TOP 1000000000 [repuestos].id FROM [repuestos] LEFT OUTER JOIN [consumos_reales] ON consumos_reales.repuesto_id = repuestos.id LEFT OUTER JOIN [consumos_previstos] ON consumos_previstos.repuesto_id = repuestos.id WHERE (consumos_reales.repuesto_id is not null OR consumos_previstos.repuesto_id is not null ) GROUP BY [repuestos].id ORDER BY MIN(codigo)) tally | |
SET NOCOUNT ON DECLARE @row_number TABLE (row int identity(1,1), id int) INSERT INTO @row_number (id) SELECT [repuestos].id FROM [repuestos] LEFT OUTER JOIN [consumos_reales] ON consumos_reales.repuesto_id = repuestos.id LEFT OUTER JOIN [consumos_previstos] ON consumos_previstos.repuesto_id = repuestos.id WHERE (consumos_reales.repuesto_id is not null OR consumos_previstos.repuesto_id is not null ) GROUP BY [repuestos].id ORDER BY MIN(codigo) SET NOCOUNT OFF SELECT id FROM ( SELECT TOP 30 * FROM ( SELECT TOP 60 * FROM @row_number ORDER BY row ) AS tmp1 ORDER BY row DESC ) AS tmp2 ORDER BY row | |
SELECT [repuestos].[i |
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
#config.time_zone = 'Madrid' | |
# Como en este caso queremos utilizar la hora local en la base de datos | |
config.active_record.default_timezone = :local | |
config.active_record.time_zone_aware_attributes = false | |
config.time_zone = nil |
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
require 'repository' | |
module Persistence | |
module Couch | |
module Repositories | |
class Agencies < Repository[:agencies] | |
def find_id(id) | |
agencies.find_id(id) | |
end | |
end |
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
#spec/rom_factories/users.rb | |
RomFactory::Builder.define do |b| | |
b.factory(relation: :users, name: :user_1) do |f| | |
f.id "ID1" | |
f.name "John" | |
f.surname "Doe" | |
end | |
end |
OlderNewer