Skip to content
This repository has been archived by the owner on Apr 26, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' into feature/move-idea-between-accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
mezis committed May 31, 2013
2 parents 344cce2 + 8c96d72 commit 3dd5217
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/controllers/attachments_controller.rb
Expand Up @@ -18,7 +18,7 @@ def create

if @attachment.save
respond_to do |format|
format.json { render json: { success: true, id:@attachment.id }, status: :ok }
format.json { render json: { success: true, id: @attachment.id }, status: :ok }
end
else
respond_to do |format|
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/notifications_controller.rb
Expand Up @@ -15,7 +15,7 @@ def index
@notifications = current_user.notifications.
send(angle_scope).
by_most_recent.
paginate(per_page:PER_PAGE, page:params[:page])
paginate(per_page: PER_PAGE, page: params[:page])
end

def update
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/user/bookmarks_controller.rb
Expand Up @@ -3,7 +3,7 @@ class User::BookmarksController < ApplicationController

def create
idea = current_account.ideas.find(params[:user_bookmark][:idea_id])
@user_bookmark = current_user.bookmarks.new(idea:idea)
@user_bookmark = current_user.bookmarks.new(idea: idea)
if @user_bookmark.save
flash[:success] = _('Bookmark successfuly added.')
else
Expand Down
4 changes: 2 additions & 2 deletions app/models/ability.rb
Expand Up @@ -10,8 +10,8 @@ def initialize(user)
can :read, Idea, author: { account_id: user.account_id }
if user.plays?(:submitter)
can :create, Idea, author: { account_id: user.account_id }
can :update, Idea, author: { account_id: user.account_id }, state:draft_or_submitted
can :destroy, Idea, author_id: user.id, state:draft_or_submitted
can :update, Idea, author: { account_id: user.account_id }, state: draft_or_submitted
can :destroy, Idea, author_id: user.id, state: draft_or_submitted
end

can :move, Idea do |idea|
Expand Down
2 changes: 1 addition & 1 deletion app/models/account.rb
Expand Up @@ -10,7 +10,7 @@ class Account < ActiveRecord::Base

store :settings, accessors: [ :categories ]

default_values auto_adopt:false, categories: lambda { Set.new }
default_values auto_adopt: false, categories: lambda { Set.new }


def categories_with_default
Expand Down
2 changes: 1 addition & 1 deletion app/models/idea/history/base.rb
Expand Up @@ -5,7 +5,7 @@ class Idea::History::Base < ActiveRecord::Base
belongs_to :idea
belongs_to :subject, polymorphic:true

scope :by_created_at, order:'created_at DESC'
scope :by_created_at, order: 'created_at DESC'

validates_presence_of :idea

Expand Down
2 changes: 1 addition & 1 deletion lib/lazy_records/cache.rb
Expand Up @@ -39,7 +39,7 @@ def eager_load
missing_ids = @records.select { |id,record| record.nil? }.keys
return if missing_ids.empty?
Rails.logger.info("eager loading #{missing_ids.count} #{model.name.pluralize}: #{missing_ids.join(', ')}")
scope = model.includes(@includes).where(id:missing_ids)
scope = model.includes(@includes).where(id: missing_ids)
@records.merge! scope.index_by(&:id)
nil
end
Expand Down

0 comments on commit 3dd5217

Please sign in to comment.