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
RSpec.describe LikertInput, type: :input do | |
class MockTemplate | |
include ActionView::Helpers | |
attr_accessor :output_buffer | |
end | |
let(:object) { double(:object, happiness: '1') } | |
let(:builder) { double(:builder, object: object) } | |
let(:input_options) { { value: '1', class: 'input-small' } } |
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 CandidateStatusEnumeration | |
def self.default | |
DEFAULT_ONE | |
end | |
def self.default_status | |
ActiveSupport::Deprecation.warn('Use default instead') | |
default | |
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
curl -X POST -F "key=<key-here>" -F "hostname=test.host&version=1&h" -F "host_string=foo" -F "version=1" http://collector.dev.netfox.com/poller |
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
logformat squid %{%s}tl %6tr %>a %Ss/%03Hs %<st %rm %ru %un %Sh/%<A %mt | |
access_log daemon:/var/log/squid/access.log squid | |
logfile_daemon /usr/bin/squid_log_writer |
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 add_constraints(scope) | |
tables = construct_tables | |
chain.each_with_index do |reflection, i| | |
table, foreign_table = tables.shift, tables.first | |
if reflection.source_macro == :has_and_belongs_to_many | |
join_table = tables.shift | |
scope = scope.joins(join( |
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 Person | |
attr_writer :job | |
def job | |
@job || NoJob.new | |
end | |
end | |
class Job | |
def title |
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
mapper = Mapper::Base.new | |
column1 = mapper.add_column "foo" | |
column1.rename :to => "bar" | |
column1.downcase | |
column2 = mapper.add_column "city" | |
column2.add_attribute :url_value => "1" |
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 MyTransformer < Transformer::Base | |
transform do | |
CSV.foreach(options[:file]) do |row| | |
add_item(row) | |
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
has_many :performances, :dependent => :destroy | |
has_many :keyword_vendor_instances, | |
:class_name => 'Scenario::Keyword::VendorInstance', | |
:foreign_key => :ad_group_vendor_instance_id | |
has_many :ad_vendor_instances, | |
:class_name => 'Scenario::Ad::VendorInstance', | |
:foreign_key => :ad_group_vendor_instance_id |
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
output += input; |