Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix images

  • Loading branch information...
commit ff4300d92726decc4027ca3074bee35916d6c390 1 parent 837b730
@jodyalbritton authored
View
1  app/models/photo.rb
@@ -4,4 +4,5 @@ class Photo < ActiveRecord::Base
acts_as_taggable # Alias for acts_as_taggable_on
has_attached_file :file, :styles => {:large=> "700x567>", :medium => "400x267>", :thumb => "90x60>" }, :default_url => "/images/:style/missing.png"
validates_attachment_content_type :file, :content_type => /\Aimage\/.*\Z/
+ validates_attachment_size :file, :in => 0.megabytes..4.megabytes
end
View
1  app/models/post.rb
@@ -4,6 +4,7 @@ class Post < ActiveRecord::Base
attr_accessor :search
has_attached_file :photo, :styles => { :large => "750x450#", :medium => "360x244#", :thumb => "100x100#" }, :default_url => ":style/missing.png"
validates_attachment_content_type :photo, :content_type => /\Aimage\/.*\Z/
+ validates_attachment_size :photo, :in => 0.megabytes..4.megabytes
crop_attached_file :photo, :aspect => "16:9"
belongs_to :author, :class_name => 'User'
belongs_to :category
View
3  app/models/sponsor.rb
@@ -1,7 +1,8 @@
class Sponsor < ActiveRecord::Base
extend FriendlyId
- has_attached_file :avatar, :styles => { :large => "600x403#", :medium => "300x300#", :thumb => "100x100>" }, :default_url => ":style/missing.png"
+ has_attached_file :avatar, :styles => { :large => "640x480>", :medium => "300x300>", :thumb => "100x100>" }, :default_url => ":style/missing.png"
validates_attachment_content_type :avatar, :content_type => /\Aimage\/.*\Z/
+ validates_attachment_size :avatar, :in => 0.megabytes..4.megabytes
friendly_id :name, use: :slugged
has_many :videos
belongs_to :category
Please sign in to comment.
Something went wrong with that request. Please try again.