This file contains hidden or 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
>> SomeModel.create(:name => 'foo') | |
NoMethodError: undefined method `virtual?' for #<ActiveRecord::ConnectionAdapters::MysqlColumn:0x1017eaea8> | |
from (irb):6:in `to_proc' | |
from /Users/kdurante/.rvm/gems/ree-1.8.7-2010.02@oracle_adapter/gems/activerecord-oracle_enhanced-adapter-1.4.0/lib/active_record/connection_adapters/oracle_enhanced_base_ext.rb:91:in `select' | |
from /Users/kdurante/.rvm/gems/ree-1.8.7-2010.02@oracle_adapter/gems/activerecord-oracle_enhanced-adapter-1.4.0/lib/active_record/connection_adapters/oracle_enhanced_base_ext.rb:91:in `arel_attributes_values' | |
from /Users/kdurante/.rvm/gems/ree-1.8.7-2010.02@oracle_adapter/gems/activerecord-3.0.7/lib/active_record/persistence.rb:253:in `update' | |
from /Users/kdurante/.rvm/gems/ree-1.8.7-2010.02@oracle_adapter/gems/activerecord-3.0.7/lib/active_record/locking/optimistic.rb:77:in `update' | |
from /Users/kdurante/.rvm/gems/ree-1.8.7-2010.02@oracle_adapter/gems/activerecord-3.0.7/lib/active_record/attribute_methods/dirty.rb:68:in `update' | |
from /Users/kdur |
This file contains hidden or 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 SomeModel < ActiveRecord::Base | |
establish_connection ActiveRecord::Base.configurations['mysql_db'] | |
end |
This file contains hidden or 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
development: | |
adapter: oracle_enhanced | |
username: development | |
password: password | |
database: oracle.local/YOUR_SID | |
mysql_db: | |
adapter: mysql | |
encoding: utf8 | |
host: localhost |
This file contains hidden or 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
source 'http://rubygems.org' | |
gem 'rails', '3.0.7' | |
gem "ruby-oci8", "2.0.4" | |
gem "activerecord-oracle_enhanced-adapter", "1.4.0" | |
gem "mysql", "2.8.1" |
This file contains hidden or 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
# Layout | |
<html> | |
<head> | |
</head> | |
<body> | |
<h1>header</h1> | |
<p>hi</p> | |
<h2>content</h2> | |
<%= yield %> |
This file contains hidden or 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
# view | |
<%- content_for :head do -%> | |
hi? | |
<esi:include src="/pricing/delivery_quote" /> | |
<%- end -%> | |
# the layout is a bit harder since it's a series of partials that will render other partials, etc. I will try to take some time to boil it down to something simple that i can post. |
This file contains hidden or 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
# environment.rb | |
Rails::Initializer.run do |config| | |
config.middleware.use(Rack::ESI, opts = {}) | |
... other configs.... | |
end |
This file contains hidden or 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
## A "Tabless" Model that you can extend to get the features and benefits | |
## of an ActiveRecord model, without having to persist anything to the database | |
class TablessModel < ActiveRecord::Base | |
self.abstract_class = true | |
def self.columns() @columns ||= []; end | |
def self.column(name, sql_type = nil, default = nil, null = true) | |
columns << ActiveRecord::ConnectionAdapters::Column.new(name.to_s, default, sql_type.to_s, null) | |
end |
NewerOlder