inline_forms 1.6.5 → 1.6.6

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.
@@ -113,7 +113,7 @@ class InlineFormsController < ApplicationController
113
113
  @update_span = params[:update]
114
114
  attributes = @inline_forms_attribute_list || @object.inline_forms_attribute_list
115
115
  attributes.each do | attribute, name, form_element |
116
- send("#{form_element.to_s}_update", @object, attribute) unless form_element == :associated
116
+ send("#{form_element.to_s}_update", @object, attribute) unless form_element == :associated || (cancan_enabled? && cannot?(:read, @Klass.to_s.underscore.pluralize.to_sym, attribute))
117
117
  end
118
118
  @parent_class = params[:parent_class]
119
119
  @parent_id = params[:parent_id]
@@ -2,7 +2,7 @@
2
2
  InlineForms::SPECIAL_COLUMN_TYPES[:money_field]=:integer
3
3
 
4
4
  def money_field_show(object, attribute)
5
- link_to_inline_edit object, attribute.to_sym, humanized_money_with_symbol(object.send attribute.to_sym)
5
+ link_to_inline_edit object, attribute, humanized_money_with_symbol(object.send attribute)
6
6
  end
7
7
 
8
8
  def money_field_edit(object, attribute)
@@ -10,6 +10,6 @@ def money_field_edit(object, attribute)
10
10
  end
11
11
 
12
12
  def money_field_update(object, attribute)
13
- object.send(attribute + "=", params[attribute])
13
+ object.send( "#{attribute}=", params[attribute])
14
14
  end
15
15
 
@@ -26,7 +26,7 @@
26
26
  </tr>
27
27
  <% attributes = @inline_forms_attribute_list || @object.inline_forms_attribute_list -%>
28
28
  <% attributes.each do | attribute, name, form_element | -%>
29
- <% unless form_element.to_sym == :associated -%>
29
+ <% unless form_element.to_sym == :associated || (cancan_enabled? && cannot?(:read, @Klass.to_s.underscore.pluralize.to_sym, attribute)) -%>
30
30
  <% css_class_id = "attribute_#{attribute}_#{@object.id}" -%>
31
31
  <tr>
32
32
  <td valign="top" class="<%= 'has_validations ' if @object.has_validations_for?(attribute) -%>" validation-hint="<%= validation_hints_as_list_for(@object, attribute) -%>">
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module InlineForms
3
- VERSION = "1.6.5"
3
+ VERSION = "1.6.6"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inline_forms
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.5
4
+ version: 1.6.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: