|
You are here |
samsaffron.com | ||
| | | | |
tenderlovemaking.com
|
|
| | | | | File.open('somefile.txt', 'wb') do |fh| # Open the file fh.write "hello world" # Do some work with the file end # Close file when block returns ActiveRecord::Base.establish_connection( :adapter => "sqlite", :database => "path/to/dbfile") connection_handle = ActiveRecord::Base.connection def retrieve_connection_pool(klass) pool = @connection_pools[klass.name] return pool if pool return nil if ActiveRecord::Base == klass retrieve_connection_pool klass.superclass end spec = ActiveRecord::Base.specificiation ActiveRecord::ConnectionPool.open(spec) do |conn| ... end spec = database_a ActiveRecord::ConnectionPool.open(spec) do |conn| User.find_all end spec = database_b ActiveRecord::ConnectionPool.open(spec) do |conn| User.find_all end # Retrieve the connection as... | |
| | | | |
somethingorotherwhatever.com
|
|
| | | | | Christian Lawson-Perfect's homepage | |
| | | | |
pganalyze.com
|
|
| | | | | We create domain types and composite types in PostgreSQL and show how to hook into the Rails Attributes API to help instantiate them as objects that Ruby can use. | |
| | | | |
valstar.dev
|
|
| | | I always prefer hosting my own projects on a simple server myself as that tends to be both cheap and flexible. And with Astro now bieng my static site generator of choice, lets go over how to host your site with TLS/SSL, a custom domain, redirects and the flexibility that comes with your own server. | ||