This file contains 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
/* | |
Converts well-formed HTML tables with class 'yui-line' or 'yui-pie' | |
to Flash charts, using YUI Loader and YUI charts. | |
Tables for pie charts look like: | |
+--------------------------------------------------+ | |
| | Total | | |
+-------------------------------------+------------+ | |
| Item 1 | 16 | |
This file contains 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
def rails_gems | |
gemrc = { | |
:verbose => true, | |
:gem => '--no-ri --no-rdoc', | |
:update_sources => true, | |
:sources => [ | |
'http://rubygems.org' | |
] | |
} | |
gemrc.merge!(configuration[:rubygems]) if configuration[:rubygems] |
This file contains 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
PID_DIR = '/srv/myapp/shared/pids' | |
RAILS_ENV = ENV['RAILS_ENV'] = 'production' | |
RAILS_ROOT = ENV['RAILS_ROOT'] = '/srv/myapp/current' | |
BIN_PATH = "/home/rails/.rvm/gems/ree-1.8.7-2010.02/bin" | |
God.log_file = "#{RAILS_ROOT}/log/god.log" | |
God.log_level = :info | |
%w(unicorn resque).each do |config| | |
God.load "#{RAILS_ROOT}/config/god/#{config}.god" |
This file contains 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
CURRENT_RUBY = 'ree-1.8.7-2010.02' | |
RUBY_PATH = "/home/rails/.rvm/rubies/#{CURRENT_RUBY}" | |
GEM_HOME = "/home/rails/.rvm/gems/#{CURRENT_RUBY}" | |
ssh_options[:paranoid] = false | |
ssh_options[:forward_agent] = true | |
default_run_options[:pty] = true | |
set :stages, %w(staging production) |
This file contains 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
# unicorn_rails -c /srv/myapp/current/config/unicorn.rb -E production -D | |
rails_env = ENV['RAILS_ENV'] || 'production' | |
working_directory (rails_env == 'production' ? "/srv/myapp/current" : `pwd`.gsub("\n", "")) | |
worker_processes (rails_env == 'production' ? 10 : 4) | |
preload_app true | |
timeout 30 | |
if rails_env == 'production' |
This file contains 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
function historySupport() { | |
return !!(window.history && window.history.pushState !== undefined); | |
} | |
function pushPageState(state, title, href) { | |
if (historySupport()) { | |
history.pushState(state, title, href); | |
} | |
} |
This file contains 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
@new := reports.downloaded_at, | |
@old := pages.created_at, | |
@oldWeek := WEEK(@old, 2), | |
@newWeek := WEEK(@new, 2), | |
@weekends := @newWeek - @oldWeek, | |
@weekendSecs := @weekends * 172800, | |
@oldWeekSaturday := STR_TO_DATE( CONCAT(DATE_FORMAT(@old, '%X%V'), ' Saturday'), '%X%V %W %h-%i-%s'), | |
@extraFirstWeekSecs := TIME_TO_SEC( TIMEDIFF(@old, @oldWeekSaturday) ), | |
@extraFirstWeekSecs := (@extraFirstWeekSecs > 0) * @extraFirstWeekSecs, | |
@newWeekSaturday := STR_TO_DATE( CONCAT(DATE_FORMAT(@new, '%X%V'), ' Saturday'), '%X%V %W %h-%i-%s'), |
This file contains 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
# Example usage: | |
# | |
# class Account < ActiveResource::Base | |
# self.site = "http://localhost:3000" | |
# end | |
# | |
# consumer = Consumer.new( user.access_token, Account ) | |
# consumer.find(1) # => equivalent to Account.find(1), but with OAuth | |
class Consumer |
This file contains 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
diff --git a/activerecord/test/cases/attribute_methods_test.rb b/activerecord/test/cases/attribute_methods_test.rb | |
index 276e4be..fd85fb7 100644 | |
--- a/activerecord/test/cases/attribute_methods_test.rb | |
+++ b/activerecord/test/cases/attribute_methods_test.rb | |
@@ -130,23 +130,6 @@ class AttributeMethodsTest < ActiveRecord::TestCase | |
assert_equal ActiveSupport::TimeZone["Pacific Time (US & Canada)"], record.written_on.time_zone | |
end | |
end | |
- | |
- def test_read_attributes_after_type_cast_on_datetime |
OlderNewer