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
attr_writer :dob, :anniversary | |
self.instance_variables.each do |x| | |
next unless self.methods.include? /#{x}=/ | |
def x | |
return ---insert a call to your custom method here--- | |
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
property :id, Serial | |
# property :account, String | |
# property :case_comments, String #needs a new model | |
# property :case_milestones, String #needs a new model | |
property :closed_date, DateTime | |
property :case_number, String | |
property :reason, String | |
property :description, String | |
property :subject, String | |
property :created_date, DateTime |
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
SalesforceAdapter::Connection::Errors::FieldNotFound: You specified case_id as a field, but neither case_id or CaseId or case_id__c exist. Either manually specify the field name with :field, or check to make sure you have provided a correct field name. | |
from /Users/kevinpoorman/.rvm/gems/ruby-1.9.2-p180@portal/bundler/gems/dm-sfdc-adapter-26449a3733c2/lib/dm-sfdc-adapter/connection.rb:59:in `field_name_for' | |
from /Users/kevinpoorman/.rvm/gems/ruby-1.9.2-p180@portal/bundler/gems/dm-sfdc-adapter-26449a3733c2/lib/dm-sfdc-adapter/adapter.rb:16:in `block in initialize' | |
from /Users/kevinpoorman/.rvm/gems/ruby-1.9.2-p180@portal/gems/dm-core-1.0.2/lib/dm-core/property.rb:481:in `call' | |
from /Users/kevinpoorman/.rvm/gems/ruby-1.9.2-p180@portal/gems/dm-core-1.0.2/lib/dm-core/property.rb:481:in `field' | |
from /Users/kevinpoorman/.rvm/gems/ruby-1.9.2-p180@portal/bundler/gems/dm-sfdc-adapter-26449a3733c2/lib/dm-sfdc-adapter/adapter.rb:129:in `block in execute_select' | |
from /Users/kevinpoorman/.rvm/gems/ruby-1.9.2-p180@por |
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 Case | |
include DataMapper::Salesforce::Resource | |
def self.reload | |
instance_methods.each { |x| undef_method(x) } | |
Kernel::load(__FILE__) | |
end | |
def self.default_repository_name |
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 CaseComment | |
include DataMapper::Salesforce::Resource | |
def self.reload | |
instance_methods.each { |x| undef_method(x) } | |
Kernel::load(__FILE__) | |
end | |
def self.default_repository_name | |
:salesforce |
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
# In response to: | |
# http://mlomnicki.com/ruby/tricks-and-quirks/2011/02/10/ruby-tricks2.html | |
# Ruby 1.9.2 has some neat stuff that lets us make a readable | |
# alternative case statement that calls each method in turn. | |
# 1.9.2 features used: | |
# * hashes are ordered in 1.9.2 | |
# * cool JSON-style hash syntax | |
# * concise lambda syntax |
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 jira_api_get(base = "#{JIRA_URL}/#{JIRA_REST_ENDPOINT}", resource = "issue", sub_resource = nil) | |
ap JIRA_URL | |
effective_url = "#{base}#{resource}/#{@ticket_key}/#{sub_resource}" | |
ap effective_url | |
request = Typhoeus::Request.get(effective_url, | |
:disable_ssl_peer_verification => true, | |
:params => {:os_username => JIRA_USER, :os_password => JIRA_PASS}) | |
return JSON.parse(request.body) if request.success? | |
if request.timed_out? |
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 jira_api_get(base, resource = "issue", sub_resource = nil) | |
base ||= "#{JIRA_URL}/#{JIRA_REST_ENDPOINT}" | |
effective_url = "#{base}#{resource}/#{@ticket_key}/#{sub_resource}" | |
ap effective_url | |
request = Typhoeus::Request.get(effective_url, | |
:disable_ssl_peer_verification => true, | |
:params => {:os_username => JIRA_USER, :os_password => JIRA_PASS}) | |
return JSON.parse(request.body) if request.success? | |
if request.timed_out? |
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 clone | |
options[:instance].each do |ami_to_clone| | |
if options[:ami] then | |
ami_id = options[:ami] | |
else | |
ami_id |
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
require 'rubygems' | |
require 'fssm' | |
require 'thor' | |
class Watcher < Thor | |
include Thor::Actions | |
def initialize(*args) | |
super | |
end |
OlderNewer