Use double quotes in models
This commit is contained in:
@@ -9,11 +9,11 @@ class Poll::Question < ActiveRecord::Base
|
||||
include Globalizable
|
||||
|
||||
belongs_to :poll
|
||||
belongs_to :author, -> { with_hidden }, class_name: 'User', foreign_key: 'author_id'
|
||||
belongs_to :author, -> { with_hidden }, class_name: "User", foreign_key: "author_id"
|
||||
|
||||
has_many :comments, as: :commentable
|
||||
has_many :answers, class_name: 'Poll::Answer'
|
||||
has_many :question_answers, -> { order 'given_order asc' }, class_name: 'Poll::Question::Answer'
|
||||
has_many :answers, class_name: "Poll::Answer"
|
||||
has_many :question_answers, -> { order "given_order asc" }, class_name: "Poll::Question::Answer"
|
||||
has_many :partial_results
|
||||
belongs_to :proposal
|
||||
|
||||
@@ -23,7 +23,7 @@ class Poll::Question < ActiveRecord::Base
|
||||
|
||||
scope :by_poll_id, ->(poll_id) { where(poll_id: poll_id) }
|
||||
|
||||
scope :sort_for_list, -> { order('poll_questions.proposal_id IS NULL', :created_at)}
|
||||
scope :sort_for_list, -> { order("poll_questions.proposal_id IS NULL", :created_at)}
|
||||
scope :for_render, -> { includes(:author, :proposal) }
|
||||
|
||||
def self.search(params)
|
||||
@@ -34,10 +34,10 @@ class Poll::Question < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def searchable_values
|
||||
{ title => 'A',
|
||||
proposal.try(:title) => 'A',
|
||||
author.username => 'C',
|
||||
author_visible_name => 'C' }
|
||||
{ title => "A",
|
||||
proposal.try(:title) => "A",
|
||||
author.username => "C",
|
||||
author_visible_name => "C" }
|
||||
end
|
||||
|
||||
def copy_attributes_from_proposal(proposal)
|
||||
|
||||
Reference in New Issue
Block a user