formotion 1.1.1 → 1.1.2

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.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 1.1.2 - October 6, 2012
2
+
3
+ ### Bug Fixes
4
+
5
+ - Raise `Formotion::NoRowTypeError` if no `RowType` (`:type`) is specified.
6
+
7
+ - Fix bug for iOS6 where some fields weren't getting their value set.
8
+
1
9
  ## 1.1.1 - September 28, 2012
2
10
 
3
11
  ### Bug Fixes
data/README.md CHANGED
@@ -96,6 +96,7 @@ form.build_section do |section|
96
96
  section.build_row do |row|
97
97
  row.title = "Label"
98
98
  row.subtitle = "Placeholder"
99
+ row.type = :string
99
100
  end
100
101
  end
101
102
  ```
@@ -122,6 +123,8 @@ You have `form#submit`, `form#on_submit`, and `form#render` at your disposal. He
122
123
  ```ruby
123
124
  class PeopleController < Formotion::FormController
124
125
  def viewDidLoad
126
+ super
127
+
125
128
  self.navigationItem.rightBarButtonItem = UIBarButtonItem.alloc.initWithBarButtonSystemItem(UIBarButtonSystemItemSave, target:self, action:'submit')
126
129
  end
127
130
 
@@ -5,5 +5,5 @@ require 'formotion'
5
5
 
6
6
  Motion::Project::App.setup do |app|
7
7
  # Use `rake config' to see complete project settings.
8
- app.name = 'Settings'
8
+ app.name = 'Login'
9
9
  end
@@ -5,5 +5,5 @@ require '../../lib/formotion'
5
5
 
6
6
  Motion::Project::App.setup do |app|
7
7
  # Use `rake config' to see complete project settings.
8
- app.name = 'KitchenSink'
8
+ app.name = 'Persistence'
9
9
  end
@@ -1,6 +1,7 @@
1
1
  module Formotion
2
2
  class InvalidClassError < StandardError; end
3
3
  class InvalidSectionError < StandardError; end
4
+ class NoRowTypeError < StandardError; end
4
5
 
5
6
  class Conditions
6
7
  class << self
@@ -231,6 +231,9 @@ module Formotion
231
231
  # Called in UITableViewDataSource methods
232
232
  # in form_delegate.rb
233
233
  def make_cell
234
+ if self.object.nil?
235
+ raise Formotion::NoRowTypeError, "No row type specified for row #{self.index_path.row} in section #{self.index_path.section}; specify a :type"
236
+ end
234
237
  cell, text_field = Formotion::RowCellBuilder.make_cell(self)
235
238
  @text_field = text_field
236
239
  self.object.after_build(cell)
@@ -58,6 +58,16 @@ module Formotion
58
58
  end
59
59
  end
60
60
 
61
+ if UIDevice.currentDevice.systemVersion >= "6.0"
62
+ field.swizzle(:setText) do
63
+ def setText(text)
64
+ r = old_setText(text)
65
+ self.sendActionsForControlEvents(UIControlEventEditingChanged)
66
+ r
67
+ end
68
+ end
69
+ end
70
+
61
71
  field.placeholder = row.placeholder
62
72
  field.text = row.value.to_s
63
73
  cell.addSubview(field)
@@ -1,3 +1,3 @@
1
1
  module Formotion
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formotion
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.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-09-28 00:00:00.000000000 Z
12
+ date: 2012-10-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bubble-wrap
@@ -194,7 +194,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
194
194
  version: '0'
195
195
  segments:
196
196
  - 0
197
- hash: -2564734151090368471
197
+ hash: -1236886504313804300
198
198
  required_rubygems_version: !ruby/object:Gem::Requirement
199
199
  none: false
200
200
  requirements:
@@ -203,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
203
203
  version: '0'
204
204
  segments:
205
205
  - 0
206
- hash: -2564734151090368471
206
+ hash: -1236886504313804300
207
207
  requirements: []
208
208
  rubyforge_project:
209
209
  rubygems_version: 1.8.23