Skip to content

Instantly share code, notes, and snippets.

View ratnikov's full-sized avatar

Dmitry Ratnikov ratnikov

  • wonder.com
  • New York, NY
View GitHub Profile
# And finally decide EopgStatistics now depends on foo
class EpgStatistics < ActiveRecord::Base
has_one :foo
validates_presence_of :foo
end
Error:
[dfr@beta trunk]$ ruby test/unit/has_attribute_based_equality_test.rb -n test_is_equal_by
Loaded suite test/unit/has_attribute_based_equality_test
Started
E
Finished in 0.005169 seconds.
1) Error:
test_is_equal_by(HasAttributeBasedEqualityTest):
module Foo
module_function
def make_foo_mod
foo_closure = "omgwtfBBQ"
Module.new do
def foo_class_var; foo_closure end
def foo_class_var= stuff; foo_closure = stuff end
end
end
end
require 'cgi'
module LoggedInControllerExtension
def self.included(base)
base.extend Setup
base.setup_logged_in
end
module Setup
def setup_logged_in
require 'cgi'
module LoggedInControllerExtension
def self.included(base)
base.extend Setup
base.setup_logged_in
end
module Setup
def setup_logged_in
var GroupStory = function() {
return {
build: function(spec) {
var private = {};
if (typeof(spec.group_id) !== "undefined") {
private.group_id = spec.group_id;
} else {
throw "group_id property missing in spec";
}
def uses(source = nil)
block = proc { yield }
klass.inject_csv_source = block_given? ? block : source
end
def para (attributes = {}, &block)
method_missing(:p, attributes, &block)
end
para do
foo = <<-END_PARAGRAPH
Hello there. I love #{input 'inputting VARIOUS things'}. I also get a kick
out of #{code 'coding various things'}. There's such a thrill in
seeing all of the exciting #{output 'output you can get'} from a
well-written program.
def para (attributes = {}, &block)
method_missing(:p, attributes, &block)
end
para do
<<-END_PARAGRAPH
Hello there. I love #{input 'inputting VARIOUS things'}. I also get a kick
out of #{code 'coding various things'}. There's such a thrill in
seeing all of the exciting #{output 'output you can get'} from a
well-written program.
def can_edit?(this_user)
=begin
if can_delete(this_user)
return true
end
if this_user.isadmin
return true
end
if user == this_user
return true