Skip to content

Commit 569b058

Browse files
committed
clean some returns
1 parent ecb44c4 commit 569b058

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

lib/active_scaffold/bridges/cancan/cancan_bridge.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,7 @@ def authorized_for_with_cancan?(options = {})
129129
crud_type_result, action_result = false, false
130130
end
131131
default_result = authorized_for_without_cancan?(options)
132-
result = (crud_type_result && action_result) || default_result
133-
result
132+
(crud_type_result && action_result) || default_result
134133
end
135134
end
136135
end

lib/active_scaffold/data_structures/action_columns.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,14 @@ def collect_visible(options = {}, &proc)
109109
end
110110

111111
def skip_column?(column, options)
112-
result = false
113112
# skip if this matches a constrained column
114-
result = true if constraint_columns.include?(column.name.to_sym)
113+
return true if constraint_columns.include?(column.name.to_sym)
115114
# skip this field if it's not authorized
116115
unless options[:for].authorized_for?(:action => options[:action], :crud_type => options[:crud_type] || action.try(:crud_type) || :read, :column => column.name)
117116
unauthorized_columns << column.name.to_sym
118-
result = true
117+
return true
119118
end
120-
result
119+
false
121120
end
122121

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

0 commit comments

Comments
 (0)