FY
Size: a a a
FY
AO
RS
posts = Post.all
t.all -
это
ActiveRecord::Relation. И пока ты не пытаешься работать с _результатом_ запроса, запроса не будет.RS
RS
2.5.1 :006 > User.all.to_sql
=> "SELECT \"users\".* FROM \"users\""
2.5.1 :007 > User.where("created_at > ?", 1.day.ago).to_sql
=> "SELECT \"users\".* FROM \"users\" WHERE (created_at > '2018-10-23 03:03:36.787374')"
RS
NameError: uninitialized constant Comment::SizeValidator2.
validates :attachment, size: true, maximum: 10.megabytes, message: 'should be less than 10MB'
ArgumentError: Either :with or :without must be supplied (but not both)
validates :attachment, format: true, with: /\.(jpg|png)\Z/i, message: 'should be jpg or png'
validates :attachment, format: true, with: /\.(jpg|png)\Z/i, message: 'should be jpg or png'
KO
Post \
.where(…
DO
validates :attachment, format: true, with: /\.(jpg|png)\Z/i, message: 'should be jpg or png'
Unknown validator: 'SizeValidator'
DO
validates :attachment, length: { maximum: 10.megabytes, message: 'should be less than 10MB' }
validates :attachment, format: { with: /\.(jpg|png)\Z/i, message: 'should be jpg or png' }
NK
RS
begin
# my code
rescue
# error handling
end
AK
AK
MS
RS
KO
AD
AD