informal 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/informal/model_no_init.rb +12 -0
- data/lib/informal/version.rb +1 -1
- data/test/model_test_cases.rb +6 -0
- metadata +5 -5
@@ -12,12 +12,24 @@ module Informal
|
|
12
12
|
attrs.each_pair { |name, value| self.send("#{name}=", value) }
|
13
13
|
end
|
14
14
|
|
15
|
+
def persisted?
|
16
|
+
false
|
17
|
+
end
|
18
|
+
|
15
19
|
def new_record?
|
16
20
|
true
|
17
21
|
end
|
18
22
|
|
23
|
+
def to_model
|
24
|
+
self
|
25
|
+
end
|
26
|
+
|
19
27
|
def to_key
|
20
28
|
[object_id]
|
21
29
|
end
|
30
|
+
|
31
|
+
def to_param
|
32
|
+
nil
|
33
|
+
end
|
22
34
|
end
|
23
35
|
end
|
data/lib/informal/version.rb
CHANGED
data/test/model_test_cases.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
module ModelTestCases
|
2
|
+
include ActiveModel::Lint::Tests
|
3
|
+
|
2
4
|
def setup
|
3
5
|
@model = self.poro_class.new(:x => 1, :y => 2)
|
4
6
|
end
|
@@ -9,6 +11,10 @@ module ModelTestCases
|
|
9
11
|
assert_nil @model.z
|
10
12
|
end
|
11
13
|
|
14
|
+
def test_persisted
|
15
|
+
assert !@model.persisted?
|
16
|
+
end
|
17
|
+
|
12
18
|
def test_new_record
|
13
19
|
assert @model.new_record?
|
14
20
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: informal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Josh Susser
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-05-02 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
87
|
requirements: []
|
88
88
|
|
89
89
|
rubyforge_project: informal
|
90
|
-
rubygems_version: 1.6.
|
90
|
+
rubygems_version: 1.6.1
|
91
91
|
signing_key:
|
92
92
|
specification_version: 3
|
93
93
|
summary: Easily use any Plain Old Ruby Object as the model for Rails form helpers.
|