Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

191
Views
¿Cómo se configura el encabezado de caducidad del clip para aws que depende del atributo de fecha del objeto?

Estoy usando gem 'paperclip', '~> 4.3', '>= 4.3.5' y gem 'aws-sdk', '< 2.0' y quiero establecer el encabezado de caducidad para el objeto que estoy guardando. Estoy haciendo algo como esto y esto está funcionando:

 has_attached_file :image, styles: { medium: "340x280#", small: "200x200#", xs: "200x140#", thumb: "80x80#", original: "400x380#"}, s3_headers:{ 'Cache-Control' => 'max-age=31557600', 'Expires' => 1.year.from_now.httpdate }

pero ahora quiero hacer
'Expires' => Model.start_date + 1.month en lugar de 1.year.from_now Pero cuando lo hago, me da un error de método indefinido. También probé self.start_date y solo start_date en lugar de Model.start_date, pero siempre aparece el mismo error. también traté de hacer

 def start_date_for_object return self.start_date + 1.month end

y luego lo hizo: 'Expires' => start_date_for_object ¡pero el mismo error! ¿Por qué no puedo llamar al atributo del modelo allí?

Gracias por tu consejo.

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!