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 'myclass' | |
traceable = MyClass.CreateTraceableObject() |
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
Last login: Wed Mar 24 16:26:40 on ttys001 | |
You have mail. | |
davidw:~ davidworkman$ cd git/iDoc/ | |
davidw:iDoc davidworkman$ rake -T | |
(in /Users/davidworkman/git/iDoc) | |
Missing the Rails 2.3.5 gem. Please `gem install -v=2.3.5 rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed. | |
davidw:iDoc davidworkman$ rails -v | |
Rails 2.3.5 |
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
begin | |
a.call_method | |
rescue NoMethodError | |
"" | |
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
class File | |
def self.basename_without_ext(filename) | |
File.basename(filename, ".*") | |
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
class Parent < ActiveRecord::Base | |
has_many :children do | |
def my_scope | |
proxy_owner.children.scoped(proxy_owner) | |
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
# Don't change this file! | |
# Configure your app in config/environment.rb and config/environments/*.rb | |
RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT) | |
module Rails | |
class << self | |
def boot! | |
unless booted? | |
preinitialize |
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
%ul | |
- @some_arr.each do |item| | |
%li= item.to_s |
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
class AdminController < ActionController::Base | |
def index | |
if can? :access, AdminController | |
//... | |
else | |
unauthorized! | |
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
def get_dependency(depend_string) | |
if depend_string =~ /@depends (.+)/ | |
return $1 | |
end | |
return "" | |
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
<% @teachers_not_in_school.each do |t| %> | |
<% school.fields_for t do |builder| %> | |
<tr> | |
<td><%= builder.check_box :id, t.id %></td> | |
<td><%= t.first_name + ' ' + t.last_name %></td> | |
</tr> | |
<% end -%> | |
<% end -%> |