active_presenter 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -79,3 +79,4 @@ ActivePresenter was created, and is maintained by {Daniel Haran}[http://danielha
79
79
  == License
80
80
 
81
81
  ActivePresenter is available under the {MIT License}[http://en.wikipedia.org/wiki/MIT_License]
82
+
@@ -59,7 +59,7 @@ module ActivePresenter
59
59
 
60
60
  self.attributes = args
61
61
  end
62
-
62
+
63
63
  # Set the attributes of the presentable instances using the type_attribute form (i.e. user_login => 'james')
64
64
  #
65
65
  def attributes=(attrs)
@@ -139,6 +139,15 @@ module ActivePresenter
139
139
  save
140
140
  end
141
141
 
142
+ # We define #id and #new_record? to play nice with form_for(@presenter) in Rails
143
+ def id # :nodoc:
144
+ nil
145
+ end
146
+
147
+ def new_record?
148
+ true
149
+ end
150
+
142
151
  protected
143
152
  def presented_instances
144
153
  presented.keys.map { |key| send(key) }
@@ -2,7 +2,7 @@ module ActivePresenter
2
2
  module VERSION
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- TINY = 5
5
+ TINY = 6
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/test/base_test.rb CHANGED
@@ -1,6 +1,14 @@
1
1
  require File.dirname(__FILE__)+'/test_helper'
2
2
 
3
3
  Expectations do
4
+ expect nil do
5
+ SignupPresenter.new.id
6
+ end
7
+
8
+ expect true do
9
+ SignupPresenter.new.new_record?
10
+ end
11
+
4
12
  expect :user => User, :account => Account do
5
13
  SignupPresenter.presented
6
14
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_presenter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Golick & Daniel Haran
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-11-21 00:00:00 -05:00
12
+ date: 2009-01-22 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies: []
15
15