ecm_courses 0.0.6.pre → 0.0.7.pre
Sign up to get free protection for your applications and to get access to all the features.
data/MIT-LICENSE
CHANGED
@@ -1,47 +1,45 @@
|
|
1
1
|
class Ecm::Courses::Course < ActiveRecord::Base
|
2
2
|
# db settings
|
3
3
|
self.table_name = 'ecm_courses_courses'
|
4
|
-
|
4
|
+
|
5
5
|
# acts as list
|
6
6
|
acts_as_list :scope => :ecm_courses_course_category
|
7
|
-
|
7
|
+
|
8
8
|
# associations
|
9
|
-
belongs_to :ecm_courses_course_category,
|
10
|
-
:class_name => Ecm::Courses::CourseCategory,
|
9
|
+
belongs_to :ecm_courses_course_category,
|
10
|
+
:class_name => Ecm::Courses::CourseCategory,
|
11
11
|
:counter_cache => :ecm_courses_courses_count
|
12
|
-
|
13
|
-
has_many :ecm_courses_course_dates,
|
14
|
-
:class_name => Ecm::Courses::CourseDate,
|
12
|
+
|
13
|
+
has_many :ecm_courses_course_dates,
|
14
|
+
:class_name => Ecm::Courses::CourseDate,
|
15
15
|
:dependent => :destroy,
|
16
16
|
:foreign_key => :ecm_courses_course_id,
|
17
17
|
:order => 'start_at'
|
18
|
-
|
18
|
+
|
19
19
|
# attibutes
|
20
|
-
attr_accessible :description,
|
21
|
-
:ecm_courses_course_category_id,
|
22
|
-
:locale,
|
20
|
+
attr_accessible :description,
|
21
|
+
:ecm_courses_course_category_id,
|
22
|
+
:locale,
|
23
23
|
:name
|
24
|
-
# :name,
|
25
|
-
# :position,
|
26
|
-
# :slug
|
27
24
|
|
28
25
|
# friendly id
|
29
26
|
extend FriendlyId
|
30
27
|
friendly_id :name, :use => :slugged
|
31
|
-
|
32
|
-
# validations
|
28
|
+
|
29
|
+
# validations
|
33
30
|
validates :ecm_courses_course_category, :presence => true
|
34
31
|
validates :locale, :inclusion => { :in => I18n.available_locales.map(&:to_s) }, :unless => Proc.new { |c| c.locale.blank? }
|
35
32
|
validates :name, :presence => true
|
36
|
-
|
33
|
+
|
37
34
|
# public methods
|
38
35
|
|
39
36
|
def heading_name
|
40
37
|
locale_prefix = (locale.blank?) ? "" : "[#{locale}] "
|
41
38
|
"#{locale_prefix}#{name}"
|
42
39
|
end
|
43
|
-
|
40
|
+
|
44
41
|
def to_s
|
45
42
|
"#{ecm_courses_course_category.name} - #{name}"
|
46
|
-
end
|
43
|
+
end
|
47
44
|
end
|
45
|
+
|
@@ -1,57 +1,58 @@
|
|
1
1
|
class Ecm::Courses::CourseCategory < ActiveRecord::Base
|
2
2
|
# db settings
|
3
3
|
self.table_name = 'ecm_courses_course_categories'
|
4
|
-
|
4
|
+
|
5
5
|
# associations
|
6
|
-
has_many :ecm_courses_courses,
|
7
|
-
:class_name => Ecm::Courses::Course,
|
6
|
+
has_many :ecm_courses_courses,
|
7
|
+
:class_name => Ecm::Courses::Course,
|
8
8
|
:dependent => :destroy,
|
9
9
|
:foreign_key => :ecm_courses_course_category_id,
|
10
10
|
:order => 'position'
|
11
|
-
|
11
|
+
|
12
12
|
# attributes
|
13
|
-
attr_accessible :description,
|
14
|
-
:ecm_courses_courses_count,
|
15
|
-
:locale,
|
16
|
-
:name,
|
17
|
-
:parent_id,
|
18
|
-
:position,
|
13
|
+
attr_accessible :description,
|
14
|
+
:ecm_courses_courses_count,
|
15
|
+
:locale,
|
16
|
+
:name,
|
17
|
+
:parent_id,
|
18
|
+
:position,
|
19
19
|
:slug
|
20
|
-
|
20
|
+
|
21
21
|
# awesome nested set
|
22
22
|
acts_as_nested_set
|
23
23
|
default_scope :order => 'lft ASC'
|
24
|
-
|
24
|
+
|
25
25
|
# friendly id
|
26
26
|
extend FriendlyId
|
27
27
|
friendly_id :name, :use => :slugged
|
28
|
-
|
28
|
+
|
29
29
|
# validations
|
30
30
|
validates :name, :presence => true, :uniqueness => { :scope => [ :parent_id ] }
|
31
31
|
validates :locale, :presence => true, :if => :root?
|
32
32
|
validates :locale, :inclusion => { :in => I18n.available_locales.map(&:to_s) }, :unless => Proc.new { |cc| cc.locale.blank? }
|
33
|
-
validates :locale, :absence => true, :unless => :root?
|
34
|
-
|
33
|
+
validates :locale, :absence => true, :unless => :root?
|
34
|
+
|
35
35
|
# public methods
|
36
36
|
def index_name
|
37
37
|
if self.root?
|
38
38
|
"[#{self.locale}] #{self.name}"
|
39
39
|
else
|
40
40
|
"#{'    ' * self.level} |-- #{self.name}".html_safe
|
41
|
-
end
|
41
|
+
end
|
42
42
|
end
|
43
|
-
|
43
|
+
|
44
44
|
def to_s
|
45
45
|
name
|
46
|
-
end
|
46
|
+
end
|
47
47
|
|
48
48
|
def tree_name
|
49
49
|
root_prefix = (self.root?) ? "[#{self.locale}] " : ""
|
50
|
-
|
50
|
+
|
51
51
|
if ecm_courses_courses_count < 1
|
52
|
-
"#{root_prefix}#{to_s}"
|
53
|
-
else
|
54
|
-
"#{root_prefix}#{to_s} (#{ecm_courses_courses_count})"
|
52
|
+
"#{root_prefix}#{to_s}"
|
53
|
+
else
|
54
|
+
"#{root_prefix}#{to_s} (#{ecm_courses_courses_count})"
|
55
55
|
end
|
56
|
-
end
|
56
|
+
end
|
57
57
|
end
|
58
|
+
|
data/lib/ecm/courses/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ecm_courses
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 961915992
|
5
5
|
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
9
|
+
- 7
|
10
10
|
- pre
|
11
|
-
version: 0.0.
|
11
|
+
version: 0.0.7.pre
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- Roberto Vasquez Angel
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date:
|
19
|
+
date: 2013-02-18 00:00:00 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: rails
|
@@ -26,12 +26,12 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
29
|
+
hash: 23
|
30
30
|
segments:
|
31
31
|
- 3
|
32
32
|
- 2
|
33
|
-
-
|
34
|
-
version: 3.2.
|
33
|
+
- 12
|
34
|
+
version: 3.2.12
|
35
35
|
type: :runtime
|
36
36
|
version_requirements: *id001
|
37
37
|
- !ruby/object:Gem::Dependency
|
@@ -40,14 +40,12 @@ dependencies:
|
|
40
40
|
requirement: &id002 !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
42
|
requirements:
|
43
|
-
- -
|
43
|
+
- - ">="
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
hash:
|
45
|
+
hash: 3
|
46
46
|
segments:
|
47
47
|
- 0
|
48
|
-
|
49
|
-
- 6
|
50
|
-
version: 0.1.6
|
48
|
+
version: "0"
|
51
49
|
type: :runtime
|
52
50
|
version_requirements: *id002
|
53
51
|
- !ruby/object:Gem::Dependency
|
@@ -56,14 +54,12 @@ dependencies:
|
|
56
54
|
requirement: &id003 !ruby/object:Gem::Requirement
|
57
55
|
none: false
|
58
56
|
requirements:
|
59
|
-
- -
|
57
|
+
- - ">="
|
60
58
|
- !ruby/object:Gem::Version
|
61
|
-
hash:
|
59
|
+
hash: 3
|
62
60
|
segments:
|
63
61
|
- 0
|
64
|
-
|
65
|
-
- 6
|
66
|
-
version: 0.0.6
|
62
|
+
version: "0"
|
67
63
|
type: :runtime
|
68
64
|
version_requirements: *id003
|
69
65
|
- !ruby/object:Gem::Dependency
|
@@ -86,14 +82,12 @@ dependencies:
|
|
86
82
|
requirement: &id005 !ruby/object:Gem::Requirement
|
87
83
|
none: false
|
88
84
|
requirements:
|
89
|
-
- -
|
85
|
+
- - ">="
|
90
86
|
- !ruby/object:Gem::Version
|
91
|
-
hash:
|
87
|
+
hash: 3
|
92
88
|
segments:
|
93
|
-
-
|
94
|
-
|
95
|
-
- 3
|
96
|
-
version: 2.1.3
|
89
|
+
- 0
|
90
|
+
version: "0"
|
97
91
|
type: :runtime
|
98
92
|
version_requirements: *id005
|
99
93
|
- !ruby/object:Gem::Dependency
|
@@ -116,15 +110,12 @@ dependencies:
|
|
116
110
|
requirement: &id007 !ruby/object:Gem::Requirement
|
117
111
|
none: false
|
118
112
|
requirements:
|
119
|
-
- -
|
113
|
+
- - ">="
|
120
114
|
- !ruby/object:Gem::Version
|
121
|
-
hash:
|
115
|
+
hash: 3
|
122
116
|
segments:
|
123
117
|
- 0
|
124
|
-
|
125
|
-
- 1
|
126
|
-
- pre
|
127
|
-
version: 0.0.1.pre
|
118
|
+
version: "0"
|
128
119
|
type: :runtime
|
129
120
|
version_requirements: *id007
|
130
121
|
- !ruby/object:Gem::Dependency
|
@@ -133,14 +124,12 @@ dependencies:
|
|
133
124
|
requirement: &id008 !ruby/object:Gem::Requirement
|
134
125
|
none: false
|
135
126
|
requirements:
|
136
|
-
- -
|
127
|
+
- - ">="
|
137
128
|
- !ruby/object:Gem::Version
|
138
|
-
hash:
|
129
|
+
hash: 3
|
139
130
|
segments:
|
140
|
-
- 4
|
141
131
|
- 0
|
142
|
-
|
143
|
-
version: 4.0.7
|
132
|
+
version: "0"
|
144
133
|
type: :runtime
|
145
134
|
version_requirements: *id008
|
146
135
|
- !ruby/object:Gem::Dependency
|
@@ -149,14 +138,12 @@ dependencies:
|
|
149
138
|
requirement: &id009 !ruby/object:Gem::Requirement
|
150
139
|
none: false
|
151
140
|
requirements:
|
152
|
-
- -
|
141
|
+
- - ">="
|
153
142
|
- !ruby/object:Gem::Version
|
154
|
-
hash:
|
143
|
+
hash: 3
|
155
144
|
segments:
|
156
145
|
- 0
|
157
|
-
|
158
|
-
- 3
|
159
|
-
version: 0.0.3
|
146
|
+
version: "0"
|
160
147
|
type: :runtime
|
161
148
|
version_requirements: *id009
|
162
149
|
- !ruby/object:Gem::Dependency
|
@@ -202,7 +189,7 @@ dependencies:
|
|
202
189
|
type: :development
|
203
190
|
version_requirements: *id012
|
204
191
|
- !ruby/object:Gem::Dependency
|
205
|
-
name:
|
192
|
+
name: sass-rails
|
206
193
|
prerelease: false
|
207
194
|
requirement: &id013 !ruby/object:Gem::Requirement
|
208
195
|
none: false
|
@@ -216,7 +203,7 @@ dependencies:
|
|
216
203
|
type: :development
|
217
204
|
version_requirements: *id013
|
218
205
|
- !ruby/object:Gem::Dependency
|
219
|
-
name:
|
206
|
+
name: coffee-rails
|
220
207
|
prerelease: false
|
221
208
|
requirement: &id014 !ruby/object:Gem::Requirement
|
222
209
|
none: false
|
@@ -230,7 +217,7 @@ dependencies:
|
|
230
217
|
type: :development
|
231
218
|
version_requirements: *id014
|
232
219
|
- !ruby/object:Gem::Dependency
|
233
|
-
name:
|
220
|
+
name: sass-rails
|
234
221
|
prerelease: false
|
235
222
|
requirement: &id015 !ruby/object:Gem::Requirement
|
236
223
|
none: false
|
@@ -243,24 +230,10 @@ dependencies:
|
|
243
230
|
version: "0"
|
244
231
|
type: :development
|
245
232
|
version_requirements: *id015
|
246
|
-
- !ruby/object:Gem::Dependency
|
247
|
-
name: sass-rails
|
248
|
-
prerelease: false
|
249
|
-
requirement: &id016 !ruby/object:Gem::Requirement
|
250
|
-
none: false
|
251
|
-
requirements:
|
252
|
-
- - ">="
|
253
|
-
- !ruby/object:Gem::Version
|
254
|
-
hash: 3
|
255
|
-
segments:
|
256
|
-
- 0
|
257
|
-
version: "0"
|
258
|
-
type: :development
|
259
|
-
version_requirements: *id016
|
260
233
|
- !ruby/object:Gem::Dependency
|
261
234
|
name: meta_search
|
262
235
|
prerelease: false
|
263
|
-
requirement: &
|
236
|
+
requirement: &id016 !ruby/object:Gem::Requirement
|
264
237
|
none: false
|
265
238
|
requirements:
|
266
239
|
- - ">="
|
@@ -273,11 +246,11 @@ dependencies:
|
|
273
246
|
- pre
|
274
247
|
version: 1.1.0.pre
|
275
248
|
type: :development
|
276
|
-
version_requirements: *
|
249
|
+
version_requirements: *id016
|
277
250
|
- !ruby/object:Gem::Dependency
|
278
251
|
name: capybara
|
279
252
|
prerelease: false
|
280
|
-
requirement: &
|
253
|
+
requirement: &id017 !ruby/object:Gem::Requirement
|
281
254
|
none: false
|
282
255
|
requirements:
|
283
256
|
- - ">="
|
@@ -287,11 +260,11 @@ dependencies:
|
|
287
260
|
- 0
|
288
261
|
version: "0"
|
289
262
|
type: :development
|
290
|
-
version_requirements: *
|
263
|
+
version_requirements: *id017
|
291
264
|
- !ruby/object:Gem::Dependency
|
292
265
|
name: rspec-rails
|
293
266
|
prerelease: false
|
294
|
-
requirement: &
|
267
|
+
requirement: &id018 !ruby/object:Gem::Requirement
|
295
268
|
none: false
|
296
269
|
requirements:
|
297
270
|
- - ">="
|
@@ -301,11 +274,11 @@ dependencies:
|
|
301
274
|
- 0
|
302
275
|
version: "0"
|
303
276
|
type: :development
|
304
|
-
version_requirements: *
|
277
|
+
version_requirements: *id018
|
305
278
|
- !ruby/object:Gem::Dependency
|
306
279
|
name: shoulda-matchers
|
307
280
|
prerelease: false
|
308
|
-
requirement: &
|
281
|
+
requirement: &id019 !ruby/object:Gem::Requirement
|
309
282
|
none: false
|
310
283
|
requirements:
|
311
284
|
- - ">="
|
@@ -315,11 +288,11 @@ dependencies:
|
|
315
288
|
- 0
|
316
289
|
version: "0"
|
317
290
|
type: :development
|
318
|
-
version_requirements: *
|
291
|
+
version_requirements: *id019
|
319
292
|
- !ruby/object:Gem::Dependency
|
320
293
|
name: factory_girl_rails
|
321
294
|
prerelease: false
|
322
|
-
requirement: &
|
295
|
+
requirement: &id020 !ruby/object:Gem::Requirement
|
323
296
|
none: false
|
324
297
|
requirements:
|
325
298
|
- - ~>
|
@@ -330,39 +303,11 @@ dependencies:
|
|
330
303
|
- 0
|
331
304
|
version: "1.0"
|
332
305
|
type: :development
|
333
|
-
version_requirements: *
|
334
|
-
- !ruby/object:Gem::Dependency
|
335
|
-
name: ffaker
|
336
|
-
prerelease: false
|
337
|
-
requirement: &id022 !ruby/object:Gem::Requirement
|
338
|
-
none: false
|
339
|
-
requirements:
|
340
|
-
- - ">="
|
341
|
-
- !ruby/object:Gem::Version
|
342
|
-
hash: 3
|
343
|
-
segments:
|
344
|
-
- 0
|
345
|
-
version: "0"
|
346
|
-
type: :development
|
347
|
-
version_requirements: *id022
|
348
|
-
- !ruby/object:Gem::Dependency
|
349
|
-
name: forgery
|
350
|
-
prerelease: false
|
351
|
-
requirement: &id023 !ruby/object:Gem::Requirement
|
352
|
-
none: false
|
353
|
-
requirements:
|
354
|
-
- - ">="
|
355
|
-
- !ruby/object:Gem::Version
|
356
|
-
hash: 3
|
357
|
-
segments:
|
358
|
-
- 0
|
359
|
-
version: "0"
|
360
|
-
type: :development
|
361
|
-
version_requirements: *id023
|
306
|
+
version_requirements: *id020
|
362
307
|
- !ruby/object:Gem::Dependency
|
363
308
|
name: rb-inotify
|
364
309
|
prerelease: false
|
365
|
-
requirement: &
|
310
|
+
requirement: &id021 !ruby/object:Gem::Requirement
|
366
311
|
none: false
|
367
312
|
requirements:
|
368
313
|
- - ~>
|
@@ -374,11 +319,11 @@ dependencies:
|
|
374
319
|
- 8
|
375
320
|
version: 0.8.8
|
376
321
|
type: :development
|
377
|
-
version_requirements: *
|
322
|
+
version_requirements: *id021
|
378
323
|
- !ruby/object:Gem::Dependency
|
379
324
|
name: guard-rspec
|
380
325
|
prerelease: false
|
381
|
-
requirement: &
|
326
|
+
requirement: &id022 !ruby/object:Gem::Requirement
|
382
327
|
none: false
|
383
328
|
requirements:
|
384
329
|
- - ">="
|
@@ -388,11 +333,11 @@ dependencies:
|
|
388
333
|
- 0
|
389
334
|
version: "0"
|
390
335
|
type: :development
|
391
|
-
version_requirements: *
|
336
|
+
version_requirements: *id022
|
392
337
|
- !ruby/object:Gem::Dependency
|
393
338
|
name: guard-bundler
|
394
339
|
prerelease: false
|
395
|
-
requirement: &
|
340
|
+
requirement: &id023 !ruby/object:Gem::Requirement
|
396
341
|
none: false
|
397
342
|
requirements:
|
398
343
|
- - ">="
|
@@ -402,7 +347,7 @@ dependencies:
|
|
402
347
|
- 0
|
403
348
|
version: "0"
|
404
349
|
type: :development
|
405
|
-
version_requirements: *
|
350
|
+
version_requirements: *id023
|
406
351
|
description: Couse management module for active admin.
|
407
352
|
email:
|
408
353
|
- roberto@vasquez-angel.de
|