apply StringLiterals cop (remove double quotes, unless there is string interpolation)

This commit is contained in:
Stella Rouzi 2014-08-18 21:54:43 +03:00
parent f91467a00a
commit b7c45718d8
45 changed files with 275 additions and 109 deletions

View file

@ -1,6 +1,6 @@
module Ahoy
class Event < ActiveRecord::Base
self.table_name = "ahoy_events"
self.table_name = 'ahoy_events'
belongs_to :visit
belongs_to :user

View file

@ -4,7 +4,7 @@ class Contact < ActiveRecord::Base
validates :conference, presence: true
# Conferences only have one contact
validates :conference_id, uniqueness: {message: "has already contact details"}
validates :conference_id, uniqueness: {message: 'has already contact details'}
validates :facebook, :twitter, :googleplus, :instagram,
format: URI::regexp(%w(http https)), allow_blank: true

View file

@ -79,7 +79,7 @@ class Datatable
sort_by << "#{sort_column(colnum)} #{sort_direction(colnum)}"
colnum += 1
end
sort_by.join(", ")
sort_by.join(', ')
end
def sorted? index=0
@ -93,6 +93,6 @@ class Datatable
def sort_direction index=0
index = "sSortDir_#{index}"
params[index] == "desc" ? "desc" : "asc"
params[index] == 'desc' ? 'desc' : 'asc'
end
end

View file

@ -0,0 +1,26 @@
class EventAttachment < ActiveRecord::Base
has_paper_trail
belongs_to :event
attr_accessible :public, :attachment, :event_id, :title
has_attached_file :attachment, path: ':rails_root/storage/:rails_env/attachments/:id/:style/:basename.:extension'
include Rails.application.routes.url_helpers
def to_jq_upload
{
'name' => read_attribute(:attachment_file_name),
'size' => read_attribute(:attachment_file_size),
'title' => read_attribute(:title),
'public' => read_attribute(:public),
#"url" => attachment.url(:original),
'url' => conference_proposal_event_attachment_path(self.event.conference.short_title, self.event_id, self.id),
'delete_url' => conference_proposal_event_attachment_path(self.event.conference.short_title, self.event_id, self.id),
'delete_type' => 'DELETE'
}
end
#:path => ":rails_root/public/system/:attachment/:id/:style/:filename",
# :url => "/system/:attachment/:id/:style/:filename"
#has_paper_trail :meta => {:associated_id => :event_id, :associated_type => "Event"}
end

View file

@ -3,7 +3,7 @@ class Photo < ActiveRecord::Base
belongs_to :conference
validates_presence_of :picture
has_attached_file :picture,
styles: { thumb: "100x100>", large: "300x300>", banner: "600x300>" }
styles: { thumb: '100x100>', large: '300x300>', banner: '600x300>' }
validates_attachment_content_type :picture,
content_type: [/jpg/, /jpeg/, /png/, /gif/],

View file

@ -1,4 +1,4 @@
class Visit < ActiveRecord::Base
has_many :ahoy_events, class_name: "Ahoy::Event"
has_many :ahoy_events, class_name: 'Ahoy::Event'
belongs_to :user
end