Skip to content

Instantly share code, notes, and snippets.

View spastorino's full-sized avatar

Santiago Pastorino spastorino

View GitHub Profile
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index e29c6c2..d65dc6b 100644
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -1610,9 +1610,9 @@ MSG
# Returns true if the +comparison_object+ is the same object, or is of the same type and has the same id.
def ==(comparison_object)
comparison_object.equal?(self) ||
- persisted? &&
- (comparison_object.instance_of?(self.class) &&
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 6076aaf..b859650 100644
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -1365,7 +1365,7 @@ MSG
def initialize(attributes = nil)
@attributes = attributes_from_column_definition
@attributes_cache = {}
- @new_record = true
+ @persisted = false
diff --git a/spec/resolver/basic_spec.rb b/spec/resolver/basic_spec.rb
index 177a7b0..f54431f 100644
--- a/spec/resolver/basic_spec.rb
+++ b/spec/resolver/basic_spec.rb
@@ -17,4 +17,11 @@ describe "Resolving" do
should_resolve_as %w(actionpack-2.3.5 activesupport-2.3.5 rack-1.0)
end
-end
\ No newline at end of file
require 'test_helper'
class ExceptionController < ActionController::Base
respond_to :html, :xml, :json
include Exceptron::Helpers
def not_found
respond_with exception
end
(in /Users/santiago/WyeWorks/Projs/rails/actionpack)
/Users/santiago/.rvm/rubies/rbx-head/bin/rbx -w -I"lib:test" "/Users/santiago/.rvm/gems/rbx-head/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/abstract/abstract_controller_test.rb" "test/abstract/callbacks_test.rb" "test/abstract/collector_test.rb" "test/abstract/helper_test.rb" "test/abstract/layouts_test.rb" "test/abstract/render_test.rb" "test/abstract/translation_test.rb" "test/controller/action_pack_assertions_test.rb" "test/controller/addresses_render_test.rb" "test/controller/assert_select_test.rb" "test/controller/base_test.rb" "test/controller/caching_test.rb" "test/controller/capture_test.rb" "test/controller/content_type_test.rb" "test/controller/deprecation/deprecated_base_methods_test.rb" "test/controller/filters_test.rb" "test/controller/flash_test.rb" "test/controller/helper_test.rb" "test/controller/http_basic_authentication_test.rb" "test/controller/http_digest_authentication_test.rb" "test/controller/http_token_authentication_test.rb
diff --git a/kernel/common/string.rb b/kernel/common/string.rb
index 78c5b35..df6e295 100644
--- a/kernel/common/string.rb
+++ b/kernel/common/string.rb
@@ -1460,9 +1460,13 @@ class String
return if @num_bytes == 0
stop = @num_bytes - 1
+ while stop >= 0 && @data[stop] == 0
+ stop -= 1
diff --git a/activemodel/lib/active_model/validations.rb b/activemodel/lib/active_model/validations.rb
index a0f9045..efd071f 100644
--- a/activemodel/lib/active_model/validations.rb
+++ b/activemodel/lib/active_model/validations.rb
@@ -147,9 +147,9 @@ module ActiveModel
# List all validators that being used to validate a specific attribute.
def validators_on(*attributes)
- attributes.inject([]) do |all, attribute|
- all |= _validators[attribute.to_sym] || []
--- /Applications/Propane.app/Contents/Resources/enhancer.js 2011-02-10 17:05:02.000000000 -0200
+++ /Applications/Propane.app/Contents/Resources/enhancer.js 2011-02-10 17:00:41.000000000 -0200
@@ -74,7 +74,7 @@
var author = message.authorElement();
if (author.visible()) {
- author.insert({after: '<img alt="'+message.author()+'" width="24" height="24" align="top" style="margin-left: 5px; border-radius:3px" src="http://globase.heroku.com/redirect/gh.gravatars.'+this.authorID(message)+'?default=https://github.com/images/gravatars/gravatar-20.png">'});
+ author.insert({after: '<img alt="'+message.author()+'" width="24" height="24" align="top" style="margin-left: 5px; border-radius:3px" src="'+author.getAttribute('data-avatar')+'">'});
author.hide()
message.bodyCell.insert({top: '<strong>' + message.author() + '</strong>'})
cd /Applications/Propane.app/Contents/Resources
cp enhancer.js enhancer.js.orig
curl https://gist.github.com/raw/820001/8ed21af6a44107c43de571e57d6c397128579aa2/propane-gravatars.diff | patch
curl https://gist.github.com/raw/821125/d31fe43f38ad3c2877a1788422bc6327b1ecde8e/propane.diff | patch
if (window.propane) {
Object.extend(Campfire.Chat.prototype, {
installPropaneResponder: function() {
if (this["propaneresponder"] == null) {
this["propaneresponder"] = new Campfire["PropaneResponder"](this);
this.listeners.push(this["propaneresponder"]);
}
},
});