diff --git a/app/helpers/photos_helper.rb b/app/helpers/photos_helper.rb index e4b0b89..868ab09 100644 --- a/app/helpers/photos_helper.rb +++ b/app/helpers/photos_helper.rb @@ -1,5 +1,5 @@ module PhotosHelper def link_to_photo(photo) - link_to '', photo.photo.url, :rel => 'photos', :class => 'fancy', :id => photo.id + link_to '', photo.photo.url, rel: 'photos', class: 'fancy', id: photo.id end end diff --git a/app/mailers/notifier.rb b/app/mailers/notifier.rb index 9e06a75..fb736f6 100644 --- a/app/mailers/notifier.rb +++ b/app/mailers/notifier.rb @@ -1,10 +1,10 @@ class Notifier < ActionMailer::Base - default :from => "enquiries@danbarberphoto.com" + default from: 'enquiries@danbarberphoto.com' def contact_notification(sender) @sender = sender - mail( :to => 'enquiries@danbarberphoto.com', - :from => sender.email, - :subject => sender.subject) + mail( to: 'enquiries@danbarberphoto.com', + from: sender.email, + subject: sender.subject) end end diff --git a/app/models/contact.rb b/app/models/contact.rb index 20f762f..646fa97 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -3,7 +3,7 @@ class Contact validates_presence_of :email, :name, :message - validates :email, :email => true + validates :email, email: true attr_accessor :id, :email, :subject, :name, :message diff --git a/app/models/photo.rb b/app/models/photo.rb index c835881..396b1ef 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -2,33 +2,33 @@ class Photo < ActiveRecord::Base has_and_belongs_to_many :categories - has_attached_file :photo, :styles => { :preview => "600x600", - :size17 => "476x476#", - :size11 => "308x308#", - :size8 => "224x224#", - :size5 => "140x140#", - :size3 => "84x84#", - :size2 => "56x56#", - :size17x2 => "952x952#", - :size11x2 => "616x616#", - :size8x2 => "448x448#", - :size5x2 => "280x280#", - :size3x2 => "168x168#", - :size2x2 => "112x112#" }, - :storage => :s3, - :s3_credentials => "#{Rails.root}/config/s3.yml", - :s3_protocol => "https", - :path => ":attachment/:id/:style.:extension", - :bucket => 'danbarberphoto', - :url => ':s3_domain_url' + has_attached_file :photo, styles: { preview: '600x600', + size17: '476x476#', + size11: '308x308#', + size8: '224x224#', + size5: '140x140#', + size3: '84x84#', + size2: '56x56#', + size17x2: '952x952#', + size11x2: '616x616#', + size8x2: '448x448#', + size5x2: '280x280#', + size3x2: '168x168#', + size2x2: '112x112#' }, + storage: :s3, + s3_credentials: "#{Rails.root}/config/s3.yml", + s3_protocol: 'https', + path: ':attachment/:id/:style.:extension', + bucket: 'danbarberphoto', + url: ':s3_domain_url' @@per_page = 11 scope :enabled, lambda { - where(:enabled => true) + where(enabled: true) } scope :featured, lambda { - enabled.where(:featured => true) + enabled.where(featured: true) } def to_s