lists 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/lists/lists_controller.rb +6 -0
- data/app/models/lists/list.rb +5 -1
- data/app/models/lists/list_item.rb +7 -1
- data/lib/lists.rb +1 -0
- data/lib/lists/version.rb +1 -1
- metadata +20 -4
data/app/models/lists/list.rb
CHANGED
@@ -1,10 +1,14 @@
|
|
1
1
|
module Lists
|
2
2
|
class List < ActiveRecord::Base
|
3
|
-
has_many :list_items
|
3
|
+
has_many :list_items, order: :position
|
4
4
|
belongs_to :listable, polymorphic: true
|
5
5
|
|
6
6
|
attr_accessible :body, :position, :subject, :listable, :listable_type, :listable_id, :list_items_attributes
|
7
7
|
|
8
8
|
accepts_nested_attributes_for :list_items, reject_if: ->(o) {o[:subject].blank? and o[:body].blank?}, allow_destroy: true
|
9
|
+
|
10
|
+
def to_s
|
11
|
+
subject
|
12
|
+
end
|
9
13
|
end
|
10
14
|
end
|
data/lib/lists.rb
CHANGED
data/lib/lists/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lists
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -43,6 +43,22 @@ dependencies:
|
|
43
43
|
- - ! '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: acts_as_list
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
46
62
|
- !ruby/object:Gem::Dependency
|
47
63
|
name: sqlite3
|
48
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -136,7 +152,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
136
152
|
version: '0'
|
137
153
|
segments:
|
138
154
|
- 0
|
139
|
-
hash:
|
155
|
+
hash: 2723496742218291152
|
140
156
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
141
157
|
none: false
|
142
158
|
requirements:
|
@@ -145,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
161
|
version: '0'
|
146
162
|
segments:
|
147
163
|
- 0
|
148
|
-
hash:
|
164
|
+
hash: 2723496742218291152
|
149
165
|
requirements: []
|
150
166
|
rubyforge_project:
|
151
167
|
rubygems_version: 1.8.24
|