lportal 1.0.17 → 1.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/ChangeLog CHANGED
@@ -1,3 +1,14 @@
1
+ = 1.0.18
2
+ - backported features from master:
3
+ - fixed layout resources relation
4
+ - comment on running tests from master branch
5
+ - print lportal version on init
6
+ - import fixture name postgresql hack to run master tests on 1.0
7
+ - fix journal article links
8
+ - using user.full as message.username if message has user
9
+ - creation of MB::Thread
10
+
11
+
1
12
  = 1.0.17
2
13
  - introduced schema versions, automatic detection from the release_ table
3
14
  - migrations imported from caterpillar trunk, define the migrations directory for caterpillar
@@ -39,7 +39,7 @@ module Journal
39
39
 
40
40
  # Path to this article. See Tag::Asset#path.
41
41
  def path
42
- self.asset.path(self.articleid)
42
+ self.asset.path
43
43
  end
44
44
 
45
45
  end
@@ -59,10 +59,10 @@ module MB
59
59
  self.anonymous = false
60
60
  #end
61
61
 
62
- self.subject ||= ''
63
- self.username ||= ''
64
62
  self.createdate = Time.now
65
63
  self.modifieddate = Time.now
64
+ self.subject ||= ''
65
+ self.username ||= self.user ? self.user.fullname : ''
66
66
  self.parentmessageid ||= 0
67
67
  self.attachments ||= false
68
68
  self.save
@@ -84,9 +84,7 @@ module MB
84
84
  unless thread
85
85
  thread = MB::Thread.create(
86
86
  :category => category,
87
- :rootmessage => self,
88
- :messagecount => 0,
89
- :viewcount => 0
87
+ :rootmessage => self
90
88
  )
91
89
  end
92
90
  thread.messagecount += 1
@@ -8,6 +8,15 @@ module MB
8
8
  'com.liferay.portlet.messageboards.model.MBThread'
9
9
  end
10
10
 
11
+ # Creates a new Thread.
12
+ #
13
+ def initialize(params)
14
+ super(params)
15
+ self.messagecount ||= 0
16
+ self.viewcount ||= 0
17
+ self.save
18
+ end
19
+
11
20
  belongs_to :category,
12
21
  :class_name => 'MB::Category',
13
22
  :foreign_key => 'categoryid'
@@ -168,8 +168,9 @@ module Web
168
168
  belongs_to :company,
169
169
  :foreign_key => 'companyid'
170
170
 
171
- has_many :resources,
172
- :foreign_key => 'primkey'
171
+ def resources
172
+ Resource.find(:all, :conditions => "primkey like '#{self.plid}'")
173
+ end
173
174
 
174
175
  def layoutset
175
176
  Web::LayoutSet.find(:first, :conditions => "groupid=#{self.groupid} AND privatelayout=#{self.privatelayout}" )
data/lportal.rb CHANGED
@@ -5,6 +5,18 @@ file = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
5
5
  this_dir = File.dirname(File.expand_path(file))
6
6
 
7
7
  require File.join(this_dir,'version')
8
+ def info(msg)
9
+ msg = 'lportal: %s' % msg
10
+ STDOUT.puts(msg)
11
+ end
12
+
13
+ info 'version ' + Lportal::VERSION
14
+
15
+ # this would be the proper place to load PostgreSQL hacks from 1.2 branch.
16
+ # fixture hack imported from master branch would be useful while running tests,
17
+ # however the test framework needs to be loaded before loading the fixture hack.
18
+ #require File.join(this_dir,'active_record','fixtures.rb')
19
+ # workaround: load that (^^) in RAILS_ROOT/test/test_helper.rb
8
20
 
9
21
  # set the migrations directory for Caterpillar
10
22
  LPORTAL_MIGRATIONS=File.expand_path(
data/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lportal
2
- VERSION='1.0.17'
2
+ VERSION='1.0.18'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lportal
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.17
4
+ version: 1.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikael Lammentausta
@@ -9,7 +9,7 @@ autorequire: init
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-03-22 00:00:00 +02:00
12
+ date: 2009-05-12 00:00:00 +03:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency