Displaying 3 results from an estimated 3 matches for "newmodel".
Did you mean:
newmode
2007 Apr 04
4
joining across databases in a find statement with include (legacy db)
Hi,
I have a legacy database ''old'' and a new database ''new'' which rails
uses. I set up models using old with establish_connection(old), and
this works well, except for include:
class OldModel < ActiveRecord::Base
establish_connection(old)
end
class NewModel < ActiveRecord::Base
has_one :old_model
end
a = OldModel.find :first
NewModel.find(:all, :include => :old_model)
will give an error like
Mysql::Error: Table ''new_db.old_models'' doesn''t exist: SELECT ... FROM
new_models LEFT OUTER JOIN old_models ON ... WHERE ....
2008 Jul 28
1
callback executed like after_save but after transaction
...ef after_save
`/usr/local/bin/update_models -i #{self.id}`
end
# controller action delete
def delete
MyModel.find(params[:id]).update_attribute(:deleted_at, Time.now) #
after_save is called when the table
end
But in this situation:
# controller action new
def new
MyModel.transaction do
newmodel = MyModel.new
othermodel = MyOtherModel.new
... other code ...
newmodel.save!
othermodel.save!
end
end
after_save gets called inside the transaction, and so the database is
not up to date! I''ve looked into ActiveRecord::Observers but this also
faces the same problem. Is...
2018 Oct 15
0
UPS BZ1500PBI-BR (Microsol - Brazil) Compatibility.
...this UPS up on a Synology NAS DS218+ which uses
NUT, and even though they are using NUT, they don't have all drivers
available as NUT has them at NUT's website.
Please see that below:
root at DSAltaCloud:/usr/syno/etc/ups# upsdrvctl start
Network UPS Tools - UPS driver controller
DSM6-2-1-newmodel-repack-23796-180722
Network UPS Tools - Generic HID driver 0.38
(DSM6-2-1-newmodel-repack-23796-180722)
USB communication driver 0.32
This APC device (051d:c812) is not (or perhaps not yet) supported
by usbhid-ups. Please make sure you have an up-to-date version of NUT. If
this does not fix the pro...