|
You are here |
janko.io | ||
| | | | |
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... | |
| | | | |
blog.arkency.com
|
|
| | | | | ||
| | | | |
greg.molnar.io
|
|
| | | | | A database transaction is a unit of work that encapsulates dependencies and is executed either completely or rolled back to the initial state. | |
| | | | |
prtksxna.com
|
|
| | | Docker, specifically Docker compose, has served me well in keeping a sane development environment for my WordPress projects. MAMP was too much of a black box, and having a local PHP and SQL for both MediaWiki and WordPress was going to be more maintenance than I would have time for. With compose I have little [...] | ||