Skip to content

Commit

Permalink
clean some returns
Browse files Browse the repository at this point in the history
  • Loading branch information
scambra committed Feb 25, 2015
1 parent ffadd1b commit 46fe023
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions lib/active_scaffold/bridges/cancan/cancan_bridge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ def authorized_for_with_cancan?(options = {})
crud_type_result, action_result = false, false
end
default_result = authorized_for_without_cancan?(options)
result = (crud_type_result && action_result) || default_result
result
(crud_type_result && action_result) || default_result
end
end
end
Expand Down
7 changes: 3 additions & 4 deletions lib/active_scaffold/data_structures/action_columns.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,14 @@ def collect_visible(options = {}, &proc)
end

def skip_column?(column, options)
result = false
# skip if this matches a constrained column
result = true if constraint_columns.include?(column.name.to_sym)
return true if constraint_columns.include?(column.name.to_sym)
# skip this field if it's not authorized
unless options[:for].authorized_for?(:action => options[:action], :crud_type => options[:crud_type] || action.try(:crud_type) || :read, :column => column.name)
unauthorized_columns << column.name.to_sym
result = true
return true
end
result
false
end

# registers a set of column objects (recursively, for all nested ActionColumns)
Expand Down

0 comments on commit 46fe023

Please sign in to comment.