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
| desc "Import access control logs" | |
| task :fetch_accesscontrol => :environment do | |
| # Logs into website and retrieved list of events. | |
| require 'rubygems' | |
| require 'mechanize' | |
| require 'logger' | |
| # Create a new mechanize object | |
| agent = Mechanize.new |
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
| sudo ln -s /usr/local/bin/ruby /usr/bin/. |
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
| scp ~/.ssh/id_rsa.pub user@server:~/.ssh/authorized_keys |
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
| I'm having some trouble working with a legacy database. I've read through a few tutorials and have started work by simply listing everything in the database with the correct column names etc. It's going well but now I've come to try and associate the models with each other. | |
| I'm getting the following error: | |
| Mysql2::Error: Unknown column 'animal.client_id' in 'where clause': SELECT `animal`.* FROM `animal` WHERE `animal`.`client_id` = 1 | |
| The models are as follows: | |
| **client.rb** |
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 Clinical < ActiveRecord::Base | |
| # ... snip rest of model... | |
| def self.income_by_month | |
| select( 'YEAR(transactiondate) as year, MONTH(transactiondate) as month, SUM(LineBalance) as income' ) | |
| .where(:payment => 0 ) | |
| .where('LineBalance <> 0' ) | |
| .where('analysiscode <> 213' ) | |
| .group(:monthyear) |
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
| Started GET "/reports" for 192.168.239.1 at 2012-05-01 14:50:47 +0100 | |
| Processing by ReportsController#index as HTML | |
| Clinical Load (0.7ms) SELECT YEAR(transactiondate) as year, MONTH(transactiondate) as month, SUM(LineBalance) as income FROM `clinical` WHERE `clinical`.`payment` = 0 AND (LineBalance <> 0) AND (analysiscode <> 213) GROUP BY monthyear ORDER BY FullDateTime DESC LIMIT 1 | |
| Mysql2::Error: Unknown column 'clinical.payment' in 'where clause': SELECT YEAR(transactiondate) as year, MONTH(transactiondate) as month, SUM(LineBalance) as income FROM `clinical` WHERE `clinical`.`payment` = 0 AND (LineBalance <> 0) AND (analysiscode <> 213) GROUP BY monthyear ORDER BY FullDateTime DESC LIMIT 1 | |
| Rendered reports/_income_by_month.erb (8.1ms) | |
| Rendered reports/index.html.erb within layouts/application (8.8ms) | |
| Completed 500 Internal Server Error in 18ms | |
| ActionView::Template::Error (Mysql2::Error: Unknown column 'clinical.payment' in 'where clause': SELECT YEAR(transactiondate) as year, MONTH(transactionda |
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 ReportMailer < ActionMailer::Base | |
| default from: "[email protected]" | |
| mail to: "[email protected]", subject: "Practice Finance Report" | |
| ReportMailer.deliver_income_by_month_report(Clinical.income_by_month) | |
| 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
| ------------------------------------------------------------------------------ | |
| RubyGems installed the following executables: | |
| /usr/local/bin/gem | |
| sudo: unable to resolve host hostname | |
| sudo: add-apt-repository: command not found |
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
| rm -rf /var/cache session | |
| ./mage mage-setup . | |
| ./mage config-set preferred_state stable | |
| ./mage list-installed | |
| ./mage list-upgrades | |
| ./mage install http://connect20.magentocommerce.com/community Mage_All_Latest --force | |
| ./shell php indexer.php reindexall |
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
| config.action_mailer.delivery_method = :smtp | |
| config.action_mailer.smtp_settings = { | |
| address: "smtp.postmarkapp.com", | |
| port: 25, | |
| enable_starttls_auto: true, | |
| user_name: ENV["9eedsdasdaskdnasd"] | |
| password: ENV["dsldkansdkad32-7eee2576ffe0"] | |
| } |