Changeset 141
- Timestamp:
- 10/06/06 15:56:43 (2 years ago)
- Files:
-
- branches/corex/radiant/app/models/page.rb (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/corex/radiant/app/models/page.rb
r136 r141 78 78 Status.find(self.status_id) 79 79 end 80 80 81 def status=(value) 81 82 self.status_id = value.id … … 150 151 151 152 class << self 153 152 154 def find_by_url(url, live = true) 153 155 root = find_by_parent_id(nil) … … 172 174 end 173 175 174 @@descendants = []175 176 def descendants 176 177 @@descendants.dup 177 178 end 178 179 def inherited_with_descendants(subclass) 180 inherited_without_descendants(subclass) 181 @@descendants << subclass 182 end 183 alias :inherited_without_descendants :inherited 184 alias :inherited :inherited_with_descendants 179 180 private 181 182 def add_descendant(subclass) 183 @@descendants ||= [] 184 @@descendants << subclass 185 end 186 187 def inherited_with_descendants(subclass) 188 add_descendant(subclass) 189 inherited_without_descendants(subclass) 190 end 191 192 alias :inherited_without_descendants :inherited 193 alias :inherited :inherited_with_descendants 185 194 186 195 end … … 215 224 216 225 private 217 218 def attributes_protected_by_default 219 default = super 220 default.delete(self.class.inheritance_column) 221 default 222 end 223 224 def update_published_at 225 write_attribute('published_at', Time.now) if (status_id.to_i == Status[:published].id) and published_at.nil? 226 true 227 end 228 229 def update_virtual 230 write_attribute('virtual', virtual?) 231 true 232 end 233 226 234 227 # def update_file_not_found 235 228 # write_attribute('file_not_found', file_not_found?) … … 264 257 end 265 258 266 259 def attributes_protected_by_default 260 default = super 261 default.delete(self.class.inheritance_column) 262 default 263 end 264 265 def update_published_at 266 write_attribute('published_at', Time.now) if (status_id.to_i == Status[:published].id) and published_at.nil? 267 true 268 end 269 270 def update_virtual 271 write_attribute('virtual', virtual?) 272 true 273 end 274 267 275 # 268 276 # <r:url />
