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 ForwardsMailbox < ApplicationMailbox | |
def process | |
Idea.create(description: mail.subject, clip: blob_from_attachment) | |
end | |
private | |
def blob_from_attachment | |
ActiveStorage::Blob.create_and_upload!( | |
io: StringIO.new(mail.attachments.first.body.to_s), |
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
49 ==> Running Formulae#formula!(mysql@5.7) | |
50 ==> Determining dependencies... | |
51 ==> brew fetch --retry cmake gdbm openssl@1.1 pkg-config python@3.8 readline sphinx-doc sqlite xz | |
52 ==> Determining dependents... | |
53 ==> Starting build of mysql@5.7 | |
54 ==> brew fetch --retry mysql@5.7 --build-bottle --force | |
55 ==> brew install --only-dependencies --verbose --build-bottle mysql@5.7 | |
56 ==> brew install --verbose --build-bottle mysql@5.7 | |
57 ==> brew audit mysql@5.7 --online --git --skip-style | |
58 ==> brew bottle --verbose --json mysql@5.7 |
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
# Aqui cargo los datos que necesitamos para contestar las consultas del agente de viajes, prefiero | |
# el Hash porque este objeto obtengo varios métodos que me permite realizar operaciones complejas | |
# sin escribir una sola línea de código, que es una de las grandes ventajas del aspecto funcional | |
# de Ruby, que permite utilizar un estilo declarativo, en vez de decirle a la computadora cómo hacer | |
# la computación le digo qué computación deseo realizar y dejo que se encargue de los detalles. | |
precios = { | |
cancun: { enero: 2500, febrero: 2300, marzo: 2000}, | |
varadero: { enero: 1700, febrero: 2000, marzo: 2200 } | |
} |
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
### Rake task | |
namespace :crawl do | |
desc "Analizar datos" | |
task :my_web_page => :environment do | |
start_page = 1 | |
end_page = 33 | |
spider = Spider.new(1) | |
puts spider.header_row |
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
#model/users.rb | |
class User < ActiveRecord::Base | |
attr_accessible :email, :password_hash, :password_salt | |
attr_accessor :password | |
before_save :encrypt_password | |
validates_confirmation_of :password | |
validates_presence_of :password, :on => :create | |
validates_presence_of :email |
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
# Needed to be separate from setup_facebook_session to avoid double render error | |
def setup_facebook_app | |
#ensure_application_is_installed_by_facebook_user unless headless_mode or params[:app_token] == Digest::MD5.hexdigest(form_authenticity_token) | |
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
def create | |
if @thing.save | |
render :partial => 'thing', :layout => false | |
else | |
render :action => 'new', :layout => false | |
end | |
end | |
$('form').live('submit', function() { |
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
<form name="frmbusqueda" action="../advanced_tel/lista_ordenes_5.php" method="post" onsubmit="return verificar()"> | |
<table width="100%" cellspacing="4"> | |
<tr> | |
<td> </td> | |
<td><input type="checkbox" name="checkbox1" value="checkbox" onClick="habilitaDeshabilitack1(this.form)"> | |
Por Area Cliente</td> | |
</tr> | |
<tr> | |
<td>Area Cliente </td> |
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 Pharmacist < ActiveRecord::Base | |
has_many :wards | |
has_many :beds, :through => :wards | |
has_many :admissions, :through => :beds | |
has_many :patients, :through => :admissions | |
... |
NewerOlder