neat-rails 0.5.0 → 0.5.1

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a92b2da8f85138f912b07947d0d3e8aa3bf0183a
4
+ data.tar.gz: 5caf0497860b39b438e0406001af6babed40670e
5
+ SHA512:
6
+ metadata.gz: 0b42c4e20d10191e2883110cf050ad355f320f3979d6d88e4c6ba0da8bc2fd3b71af5741b0b0b4a78d8ff6ea021c7513de6ad192a44623fbed49cd5310c569a5
7
+ data.tar.gz: d026368a4b4060f607e0acd7839e29b85af97957b8b3092219e9ce66229329d3fcfcbd80b87f3d4182b831eddc8f2c53209164dc423bd7acf57f538faffa8db8
@@ -1,5 +1,5 @@
1
1
  module Neat
2
2
  module Rails
3
- VERSION = "0.5.0"
3
+ VERSION = "0.5.1"
4
4
  end
5
5
  end
@@ -31,8 +31,7 @@ class window.Neat.ModelEditor extends Backbone.View
31
31
  @edit() if @canEdit() and !$(e.target).isIn('input, button, a, label')
32
32
 
33
33
  render: ->
34
- json = _.extend(@model.toJSON(), {options: @templateOptions})
35
- @$el.html @template()(json)
34
+ @$el.html @template()(@context())
36
35
  @$el.attr('id', "#{@resource}_#{@model.get('id')}") # e.g. "calendar_5"
37
36
 
38
37
  @afterRender()
@@ -77,6 +76,10 @@ class window.Neat.ModelEditor extends Backbone.View
77
76
  @debug 'saving: ', newAttributes
78
77
  attributes = @model.changedAttributes(newAttributes)
79
78
 
79
+ # If we're not waiting, the model is updated, so if there's an error,
80
+ # you potentially still need to re-submit the model for save.
81
+ attributes ||= {} unless @waitOnSave
82
+
80
83
  return unless @okToSave(attributes)
81
84
 
82
85
  if attributes
@@ -95,6 +98,9 @@ class window.Neat.ModelEditor extends Backbone.View
95
98
  okToSave: (attributes)->
96
99
  true
97
100
 
101
+ context: ->
102
+ _.extend(@model.toJSON(), {options: @templateOptions})
103
+
98
104
  attributesFromForm: ($el) ->
99
105
  attrs = {}
100
106
  $el.find('input, select, textarea').each ->
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neat-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
5
- prerelease:
4
+ version: 0.5.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Bob Lail
@@ -10,22 +9,20 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2016-04-05 00:00:00.000000000 Z
12
+ date: 2017-03-29 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: rake
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
- - - ! '>='
18
+ - - ">="
21
19
  - !ruby/object:Gem::Version
22
20
  version: '0'
23
21
  type: :development
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
24
  requirements:
28
- - - ! '>='
25
+ - - ">="
29
26
  - !ruby/object:Gem::Version
30
27
  version: '0'
31
28
  description: It allows editing collections and models inline
@@ -36,7 +33,7 @@ executables: []
36
33
  extensions: []
37
34
  extra_rdoc_files: []
38
35
  files:
39
- - .gitignore
36
+ - ".gitignore"
40
37
  - Gemfile
41
38
  - LICENSE.txt
42
39
  - README.md
@@ -58,32 +55,25 @@ files:
58
55
  - vendor/assets/javascripts/neat/renderer/paginated.coffee
59
56
  homepage: ''
60
57
  licenses: []
58
+ metadata: {}
61
59
  post_install_message:
62
60
  rdoc_options: []
63
61
  require_paths:
64
62
  - lib
65
63
  required_ruby_version: !ruby/object:Gem::Requirement
66
- none: false
67
64
  requirements:
68
- - - ! '>='
65
+ - - ">="
69
66
  - !ruby/object:Gem::Version
70
67
  version: '0'
71
- segments:
72
- - 0
73
- hash: -2190152860109017268
74
68
  required_rubygems_version: !ruby/object:Gem::Requirement
75
- none: false
76
69
  requirements:
77
- - - ! '>='
70
+ - - ">="
78
71
  - !ruby/object:Gem::Version
79
72
  version: '0'
80
- segments:
81
- - 0
82
- hash: -2190152860109017268
83
73
  requirements: []
84
74
  rubyforge_project:
85
- rubygems_version: 1.8.23.2
75
+ rubygems_version: 2.5.1
86
76
  signing_key:
87
- specification_version: 3
77
+ specification_version: 4
88
78
  summary: It's like FreightTrain for Backbone. That's pretty neat!
89
79
  test_files: []