Skip to content

Instantly share code, notes, and snippets.

diff --git a/activerecord_base_without_table/lib/active_record/base_without_table.rb b/activerecord_base_without_table/lib/active_record/base_without_table.rb
index da6cdc8..429d121 100644
--- a/activerecord_base_without_table/lib/active_record/base_without_table.rb
+++ b/activerecord_base_without_table/lib/active_record/base_without_table.rb
@@ -6,6 +6,9 @@ module ActiveRecord
errors.empty?
end
+ # Prevent AR from associating to this record by ID; we should be serialized instead.
+ private :quoted_id
diff --git a/activerecord_base_without_table/lib/active_record/base_without_table.rb b/activerecord_base_without_table/lib/active_record/base_without_table.rb
index 429d121..c6af6eb 100644
--- a/activerecord_base_without_table/lib/active_record/base_without_table.rb
+++ b/activerecord_base_without_table/lib/active_record/base_without_table.rb
@@ -1,6 +1,8 @@
module ActiveRecord
class BaseWithoutTable < Base
self.abstract_class = true
+ class_inheritable_array :columns
+ self.columns = []
// From http://developer.yahoo.com/yui/3/examples/overlay/overlay-io-plugin.html
YUI3.use('overlay', 'io', function(Y) {
function Lightbox(config) {
arguments.callee.superclass.constructor.call(this, config);
};
Lightbox.NAME = "lightbox";
Lightbox.NS = "lightbox";
Y.extend(Lightbox, Y.Overlay, {
diff --git a/lib/hoptoad_notifier.rb b/lib/hoptoad_notifier.rb
index 1301daa..5b568d2 100644
--- a/lib/hoptoad_notifier.rb
+++ b/lib/hoptoad_notifier.rb
@@ -256,7 +256,10 @@ module HoptoadNotifier
private
def public_environment? #nodoc:
- defined?(RAILS_ENV) and !['development', 'test'].include?(RAILS_ENV)
+ if defined?(RAILS_ENV)
<html>
<head>
<title>Test</title>
<script src="http://yui.yahooapis.com/3.0.0b1/build/yui/yui-min.js" type="text/javascript"></script>
</head>
<body>
<form>
<div class="thediv">
<textarea name="textarea">Foo</textarea>
</div>
<div id="caption1" class="yui-caption-content">
<div class="view">
<h3>Title</h3>
</div>
<div class="edit">
<input value="" name="title" />
<button type="button">Save</button>
</div>
</div>
.yui-caption-content .edit { display: none; }
.yui-caption-content.editing .edit { display: block; }
.yui-caption-content.editing .view { display: none: } /* if you like */
Caption.ATTRS = {
title_element: {},
edit_input: {},
edit_button: {},
save_button: {}
};
Caption.HTML_PARSER = {
title_element: '.view h3',
edit_input: '.edit input',
We couldn’t find that file to show.
YUI.add('paginator', function(Y) {
Y.Test = Y.Base.create('test', Y.Widget, [Y.WidgetParent, Y.WidgetChild], {
initializer: function (config) { ... }
}, {
CONTENT_TEMPLATE: '<ul></ul>',
ATTRS: { ... }
});
}, '0.1', {requires: ['widget', 'selector-css3', 'widget-parent', 'widget-child'] });