Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Cms::PersistentUser instead of Cms::User for model relations and tas... #709

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/models/cms/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ class Task < ActiveRecord::Base
CANT_ASSIGN_MESSAGE = "must have permission to assign tasks"
CANT_BE_ASSIGNED_MESSAGE = "must have permission to be assigned tasks"
include Cms::DomainSupport
belongs_to :assigned_by, :class_name => 'Cms::User'
belongs_to :assigned_to, :class_name => 'Cms::User'
belongs_to :assigned_by, :class_name => 'Cms::PersistentUser'
belongs_to :assigned_to, :class_name => 'Cms::PersistentUser'
belongs_to :page, :class_name => 'Cms::Page'

extend DefaultAccessible
Expand Down
2 changes: 1 addition & 1 deletion app/views/cms/tasks/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<%= render layout: 'form_with_buttons', locals: {f: f} do %>
<%= f.association :assigned_to,
label: "Assign To",
collection: Cms::User.active.able_to_edit_or_publish_content.order("first_name, last_name, login"),
collection: Cms::PersistentUser.active.able_to_edit_or_publish_content.order("first_name, last_name, login"),
include_blank: false,
label_method: :full_name_with_login
%>
Expand Down
4 changes: 2 additions & 2 deletions lib/cms/behaviors/userstamping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ def is_userstamped(options={})
extend ClassMethods
include InstanceMethods

belongs_to :created_by, :class_name => "Cms::User"
belongs_to :updated_by, :class_name => "Cms::User"
belongs_to :created_by, :class_name => "Cms::PersistentUser"
belongs_to :updated_by, :class_name => "Cms::PersistentUser"

before_save :set_userstamps

Expand Down