Wrong revision order after upgrading to DMSF 1.6.2 #1004
This commit is contained in:
parent
1b6b9c4628
commit
ee8b7b8631
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
/redmine_dmsf.iml
|
||||
/test/fixtures/files/**
|
||||
!/test/fixtures/files/2017/**
|
||||
Gemfile.lock
|
||||
|
||||
@ -37,9 +37,9 @@ class DmsfFile < ActiveRecord::Base
|
||||
belongs_to :dmsf_folder
|
||||
belongs_to :deleted_by_user, :class_name => 'User', :foreign_key => 'deleted_by_user_id'
|
||||
|
||||
has_many :dmsf_file_revisions, -> { order("#{DmsfFileRevision.table_name}.created_at DESC, #{DmsfFileRevision.table_name}.id DESC") },
|
||||
:dependent => :destroy
|
||||
has_many :locks, -> { where(entity_type: 0).order("#{DmsfLock.table_name}.updated_at DESC") },
|
||||
has_many :dmsf_file_revisions, -> { order(created_at: :desc, id: :desc) },
|
||||
:dependent => :destroy
|
||||
has_many :locks, -> { where(entity_type: 0).order(updated_at: :desc) },
|
||||
:class_name => 'DmsfLock', :foreign_key => 'entity_id', :dependent => :destroy
|
||||
has_many :referenced_links, -> { where target_type: DmsfFile.model_name.to_s},
|
||||
:class_name => 'DmsfLink', :foreign_key => 'target_id', :dependent => :destroy
|
||||
|
||||
@ -39,7 +39,7 @@ class DmsfFolder < ActiveRecord::Base
|
||||
has_many :dmsf_links, :dependent => :destroy
|
||||
has_many :referenced_links, -> { where(target_type: 'DmsfFolder') },
|
||||
:class_name => 'DmsfLink', :foreign_key => 'target_id', :dependent => :destroy
|
||||
has_many :locks, -> { where(entity_type: 1).order("#{DmsfLock.table_name}.updated_at DESC") },
|
||||
has_many :locks, -> { where(entity_type: 1).order(updated_at: :desc) },
|
||||
:class_name => 'DmsfLock', :foreign_key => 'entity_id', :dependent => :destroy
|
||||
has_many :dmsf_folder_permissions, :dependent => :destroy
|
||||
|
||||
|
||||
@ -19,10 +19,10 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class DmsfWorkflow < ActiveRecord::Base
|
||||
has_many :dmsf_workflow_steps, -> { order 'step ASC, operator DESC' }, :dependent => :destroy
|
||||
has_many :dmsf_workflow_steps, -> { order(step: :asc, operator: :desc) }, dependent: :destroy
|
||||
belongs_to :author, :class_name => 'User'
|
||||
|
||||
scope :sorted, lambda { order(:name => :asc) }
|
||||
scope :sorted, lambda { order(name: :asc) }
|
||||
scope :global, lambda { where(project_id: nil) }
|
||||
scope :active, lambda { where(status: STATUS_ACTIVE) }
|
||||
scope :status, lambda { |arg| where(arg.blank? ? nil : {:status => arg.to_i}) }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user