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
# And finally decide EopgStatistics now depends on foo | |
class EpgStatistics < ActiveRecord::Base | |
has_one :foo | |
validates_presence_of :foo | |
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
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): |
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
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 |
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
require 'cgi' | |
module LoggedInControllerExtension | |
def self.included(base) | |
base.extend Setup | |
base.setup_logged_in | |
end | |
module Setup | |
def setup_logged_in |
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
require 'cgi' | |
module LoggedInControllerExtension | |
def self.included(base) | |
base.extend Setup | |
base.setup_logged_in | |
end | |
module Setup | |
def setup_logged_in |
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
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"; | |
} |
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 uses(source = nil) | |
block = proc { yield } | |
klass.inject_csv_source = block_given? ? block : source | |
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
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. |
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 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. |
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 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 |
OlderNewer