diff --git a/app/controllers/admin/admin_users_controller.rb b/app/controllers/admin/admin_users_controller.rb index ec4e7ac..b2f1376 100644 --- a/app/controllers/admin/admin_users_controller.rb +++ b/app/controllers/admin/admin_users_controller.rb @@ -1,17 +1,17 @@ class Admin::AdminUsersController < Admin::AdminController - + def index @admin_users = AdminUser.all end - + def new @admin_user = AdminUser.new end - + def edit @admin_user = AdminUser.find(params[:id]) end - + def update @admin_user = AdminUser.find(params[:id]) @@ -54,7 +54,7 @@ class Admin::AdminUsersController < Admin::AdminController def edit_password @admin_user = current_admin_user end - + def update_password @admin_user = current_admin_user diff --git a/app/controllers/admin/categories_controller.rb b/app/controllers/admin/categories_controller.rb index fa5a6d9..62ebbe3 100644 --- a/app/controllers/admin/categories_controller.rb +++ b/app/controllers/admin/categories_controller.rb @@ -1,17 +1,17 @@ class Admin::CategoriesController < Admin::AdminController - + def index @categories = Category.all end - + def new @category = Category.new end - + def edit @category = Category.find(params[:id]) end - + def update @category = Category.find(params[:id]) diff --git a/app/controllers/admin/pages_controller.rb b/app/controllers/admin/pages_controller.rb index ef63b69..df6c4bd 100644 --- a/app/controllers/admin/pages_controller.rb +++ b/app/controllers/admin/pages_controller.rb @@ -1,17 +1,17 @@ class Admin::PagesController < Admin::AdminController - + def index @pages = Page.all end - + def new @page = Page.new end - + def edit @page = Page.find(params[:id]) end - + def update @page = Page.find(params[:id]) diff --git a/app/controllers/admin/photos_controller.rb b/app/controllers/admin/photos_controller.rb index 70ff80a..afad01c 100644 --- a/app/controllers/admin/photos_controller.rb +++ b/app/controllers/admin/photos_controller.rb @@ -1,18 +1,18 @@ class Admin::PhotosController < Admin::AdminController before_filter :get_categories - + def index @photos = Photo.paginate(:page => params[:page]) end - + def new @photo = Photo.new end - + def edit @photo = Photo.find(params[:id]) end - + def update @photo = Photo.find(params[:id]) @@ -50,9 +50,9 @@ class Admin::PhotosController < Admin::AdminController format.xml { head :ok } end end - + private - + def get_categories @categories = Category.all end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index b2544fc..35900bd 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -8,5 +8,5 @@ class ApplicationController < ActionController::Base def after_sign_out_path_for(resource_or_scope) new_admin_user_session_path end - + end diff --git a/app/mailers/notifier.rb b/app/mailers/notifier.rb index 12f7675..9e06a75 100644 --- a/app/mailers/notifier.rb +++ b/app/mailers/notifier.rb @@ -1,6 +1,6 @@ class Notifier < ActionMailer::Base default :from => "enquiries@danbarberphoto.com" - + def contact_notification(sender) @sender = sender mail( :to => 'enquiries@danbarberphoto.com', diff --git a/app/models/admin_user.rb b/app/models/admin_user.rb index d74ea3d..32f8d25 100644 --- a/app/models/admin_user.rb +++ b/app/models/admin_user.rb @@ -6,7 +6,7 @@ class AdminUser < ActiveRecord::Base # Setup accessible (or protected) attributes for your model attr_accessible :email, :password, :password_confirmation, :remember_me - + # new function to set the password without knowing the current password used in our confirmation controller. def attempt_set_password(params) p = {} @@ -14,7 +14,7 @@ class AdminUser < ActiveRecord::Base p[:password_confirmation] = params[:password_confirmation] update_attributes(p) end - + # new function to return whether a password has been set def has_no_password? self.encrypted_password.blank? diff --git a/app/models/contact.rb b/app/models/contact.rb index 4400d39..e4c1d02 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -2,20 +2,20 @@ require 'email_validator' class Contact include ActiveModel::Validations - + validates_presence_of :email, :name, :message validates :email, :email => true attr_accessor :id, :email, :subject, :name, :message - + def initialize(attributes = {}) attributes.each do |key, value| self.send("#{key}=", value) end @attributes = attributes end - + def read_attribute_for_validation(key) @attributes[key] end @@ -27,5 +27,5 @@ class Contact end return false end - + end diff --git a/app/models/photo.rb b/app/models/photo.rb index b43fe11..02406d0 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -2,19 +2,19 @@ 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#" }, - :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#" }, + :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 diff --git a/lib/email_validator.rb b/lib/email_validator.rb index 9ea5219..f0dc9d9 100644 --- a/lib/email_validator.rb +++ b/lib/email_validator.rb @@ -6,5 +6,5 @@ class EmailValidator < ActiveModel::EachValidator object.errors[attribute] << (options[:message] || "is not valid") end end - + end