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
# Test File | |
class Test | |
def test() puts 'test'; nil | |
end | |
LOL = "Hello" |
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
class Outlay < ActiveRecord::Base | |
def self.budget(scopes = {}, pivot_value = nil) | |
pivot_value ||= "top_10_competitors" | |
projection_value = {}.tap do |projection| | |
pvs = Outlay.pivot_values(pivot_value, scopes) | |
pvs.each do |pivot| | |
projection[pivot] = {} | |
pivot_scopes = ({(pivot_value=="top_10_competitors" ? "contractor" : pivot_value) => pivot}.merge(scopes)) |
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
page.insert_html(:top, :phaseslist , sortable_element('phaseslist', :url => sort_projects_path, :handle => 'handle'), :partial => "project_phase", :object => @project_phase) | |
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
class ClassWithAttr | |
def self.my_attr_accessor(attr_name) | |
define_method("#{attr_name}=") do |arg| | |
instance_variable_set("@#{attr_name}", arg) | |
end | |
define_method(attr_name) do | |
instance_variable_get("@#{attr_name}") | |
end | |
end | |