This file contains hidden or 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
<%@ taglib prefix="stripes" uri="http://stripes.sourceforge.net/stripes.tld"%> | |
<%@ page import="edu.mit.broad.cbip.web.CbipJspConstants" %> | |
<%@page import="edu.mit.broad.cbip.web.compound.management.CreateMotherTubesFromMasterTubesActionBean"%> | |
<stripes:layout-render name="<%= CbipJspConstants.BASIC_LAYOUT_JSP %>"> | |
<stripes:layout-component name="title"> | |
</stripes:layout-component> | |
<stripes:layout-component name="contents"> | |
<stripes:form beanclass="<%= CreateMotherTubesFromMasterTubesActionBean.class %>" > |
This file contains hidden or 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
unless logged_in? | |
unless params[:captcha] && Digest::SHA1.hexdigest(params[:captcha].upcase.chomp)[0..5] == params[:captcha_guide] | |
@item.errors.add("Word") | |
render :action => 'new' | |
return | |
end | |
end |
This file contains hidden or 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 exact_distance_of_time_in_words(from_time, to_time = 0, include_seconds = false) | |
from_time = from_time.to_time if from_time.respond_to?(:to_time) | |
to_time = to_time.to_time if to_time.respond_to?(:to_time) | |
distance_in_seconds = ((to_time - from_time).abs).round | |
distance_in_minutes = (distance_in_seconds / 60).round | |
distance_in_hours = (distance_in_minutes / 60).round | |
This file contains hidden or 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 AttachmentFuMacros | |
def should_have_attachment() | |
klass = model_class | |
should "define AttachmentFu class methods" do | |
# breakpoint | |
class_modules = (class << klass; included_modules; end) | |
assert class_modules.include?(Technoweenie::AttachmentFu::ClassMethods), | |
"#{klass} doesn't define AttachmentFu class methods" |
This file contains hidden or 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 AttachmentFuMacros | |
def should_have_attachment(options = {}) | |
klass = model_class | |
should_have_db_columns :size, :content_type, :filename | |
if options[:content_type] == :image | |
should_have_db_columns :height, :width | |
end | |
should "define AttachmentFu class methods" do |
This file contains hidden or 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 Clearance | |
module Model | |
def included(base) | |
base.class_eval do | |
attr_accessible :email, :password, :password_confirmation | |
attr_accessor :password, :password_confirmation | |
validates_presence_of :email |
This file contains hidden or 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 Clearance | |
module UnitTest | |
def self.included(base) | |
base.class_eval do | |
should_require_attributes :email, :password | |
should_require_unique_attributes :email | |
should "require password validation on create" do | |
user = User.new(:password => "blah", :password_confirmation => "boogidy") |
This file contains hidden or 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
Josh: | |
My name is <snip> and I am a Tech Recruiter in NYC. I came across your blog on Google and laughed out loud when I saw the following – | |
* "If you were to record him playing hacky sack, and then edit out the hacky sack, he would have some sick dance moves." | |
Hahahahahaha. Sorry Josh, but I am going to make that part of my repertoire and totally not give you credit! | |
<snip> | |
Sr. Account Manager |
This file contains hidden or 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
(rdb:1) @time = Time.utc(2000, "jan", 1, 20, 15, 1) | |
Sat Jan 01 20:15:01 UTC 2000 | |
(rdb:1) @note.created_at = @time | |
Sat Jan 01 20:15:01 UTC 2000 | |
(rdb:1) p @time | |
Sat Jan 01 20:15:01 UTC 2000 | |
(rdb:1) p @note.created_at | |
Sat, 01 Jan 2000 15:15:01 EST -05:00 |
OlderNewer