http://guides.rubyonrails.org/migrations.html
- add_column
- add_index
- change_column
- change_table
- create_table
- drop_table
http://guides.rubyonrails.org/migrations.html
require 'singleton' | |
class MailgunConnector | |
include Singleton | |
attr_reader :api_key | |
def client(api_key=settings.mailgun_key) | |
if @api_key == api_key && @api_key | |
@client |
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
SELECT objects.name FROM objects JOIN object_types ON objects.object_type_id = object_types.object_type_id AND object_types.name = 'Building' WHERE NOT EXISTS (SELECT params.object_id FROM params, attributes WHERE objects.object_id = params.object_id AND attributes.attr_id = params.attr_id AND attributes.name = 'E-mail' AND params.text_value REGEXP '^[0-9a-zA-Z_\.\-]+@.*\.[a-z]+$') |
class QuestionRow | |
def initialize(internal_id: nil, chapter: nil, position: nil, text: nil, images: nil, video: nil, explanation: nil, | |
error_points: nil, prerequisite_id: nil, external_id: nil, choices: nil) | |
method(__method__).parameters.each do |type, name| | |
if type == :key | |
instance_variable_set "@#{name}", eval("#{name}") | |
self.class.class_eval { attr_reader name} | |
end | |
end | |
end |
module PaymentMethods | |
class Base | |
def request_url(params) | |
raise 'Not implemented' | |
end | |
def response_notification | |
raise 'Not implemented' | |
end | |
end |
# /payment_methods/ | |
# /payment_methods/obt/request.rb | |
# /payment_methods/obt/notification.rb | |
# /payment_methods/skrill/request.rb | |
# /payment_methods/skrill/notification.rb | |
# /payment_methods/base_request.rb | |
# /payment_methods/base_notification.rb | |
# /payment_provider.rb | |
module PaymentMethods |
require 'rubygems' | |
require 'rspec/core/rake_task' | |
require 'yard' | |
desc "Run all examples" | |
RSpec::Core::RakeTask.new(:spec) do |t| | |
#t.rspec_path = 'bin/rspec' | |
t.rspec_opts = %w[--color] | |
end |
require 'spec' | |
puts 1 |