summaryrefslogtreecommitdiff
path: root/app/models/node.rb
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-06-25 04:34:55 +0200
committererdgeist <erdgeist@erdgeist.org>2026-06-25 04:34:55 +0200
commitf7a5944a1f44ede9881d368a36eb9f7d82d6ab69 (patch)
tree3803e9840eab4976b299a8cce969b7785b018b19 /app/models/node.rb
parent3f236c7a0e544db94ef822f120d649ac5ee958f7 (diff)
Rails 4.2 model and controller fixes
- Wrap all scopes in lambdas (required in Rails 4) - Move scopes after associations in page.rb (evaluated at load time in Rails 4) - Convert association :order options to lambda syntax - Remove attr_accessible from page.rb and user.rb - Add Strong Parameters: user_params in UsersController, node_params/page_params in NodesController - Fix clone_attributes_from: exclude id/page_id/timestamps when cloning translations - Fix redirect_to :back → request.referer fallback in nodes_controller - Fix node_path/publish and unlock actions: pass @node argument
Diffstat (limited to 'app/models/node.rb')
-rw-r--r--app/models/node.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/node.rb b/app/models/node.rb
index 3cab7ed..8be6daf 100644
--- a/app/models/node.rb
+++ b/app/models/node.rb
@@ -3,7 +3,7 @@ class Node < ActiveRecord::Base
3 acts_as_nested_set 3 acts_as_nested_set
4 4
5 # Associations 5 # Associations
6 has_many :pages, :order => "revision ASC", :dependent => :destroy 6 has_many :pages, -> { order("revision ASC") }, :dependent => :destroy
7 belongs_to :head, :class_name => "Page", :foreign_key => :head_id, :dependent => :destroy 7 belongs_to :head, :class_name => "Page", :foreign_key => :head_id, :dependent => :destroy
8 belongs_to :draft, :class_name => "Page", :foreign_key => :draft_id, :dependent => :destroy 8 belongs_to :draft, :class_name => "Page", :foreign_key => :draft_id, :dependent => :destroy
9 has_many :permissions, :dependent => :destroy 9 has_many :permissions, :dependent => :destroy