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
class ChangeEnumMigration < ActiveRecord::Migration | |
include MigrationTools | |
def change | |
migrate_enum :some_enum, [:some_table, :some_column, null: false, default: 'other'], | |
keep_values: %w(foo bar), | |
new_values: %w(baz qux), | |
mappings: {'quux' => 'mux'}, | |
removed_values: %w(baaaz baaz) | |
end |
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
apt-get -y update | |
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev | |
cd /tmp | |
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p429.tar.gz | |
tar -xvzf ruby-1.9.3-p429.tar.gz | |
cd ruby-1.9.3-p429/ | |
./configure --prefix=/usr/local | |
make | |
make install |
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
# issue 8048 | |
gem 'rails', '3.2.8' | |
require 'action_mailer' | |
ActionMailer::Base.delivery_method = :test | |
class TestMailer < ActionMailer::Base | |
def anything | |
mail(to: "someone") |
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/lib/active_record/attribute_methods/dirty.rb b/activerecord/lib/active_record/attribute_methods/dirty.rb | |
index 433d508..10ae5dc 100644 | |
--- a/activerecord/lib/active_record/attribute_methods/dirty.rb | |
+++ b/activerecord/lib/active_record/attribute_methods/dirty.rb | |
@@ -86,7 +86,15 @@ module ActiveRecord | |
# be typecast back to 0 (''.to_i => 0) | |
value = nil | |
else | |
- value = column.type_cast(value) | |
+ # if time zone aware attributes, attribute is |
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
gem 'rails', '3.2.1' | |
require 'active_record' | |
# Print out what version we're running | |
puts "Active Record #{ActiveRecord::VERSION::STRING}" | |
ActiveRecord::Base.time_zone_aware_attributes = true | |
ActiveRecord::Base.default_timezone = :utc | |
Time.zone = 'Amsterdam' |