Skip to content

Commit b91351e

Browse files
committed
This is how you provide backwards compatibility for Ruby 1.8.7. Optional arguments to the :my scope for permissions.
1 parent afc21aa commit b91351e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/fat_free_crm/permissions.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ def uses_user_permissions
4242
# :order => primary key descending
4343
# :limit => none
4444
#
45-
scope :my, lambda { |options = {}|
45+
scope :my, lambda { |*args|
46+
options = args[0] || {}
4647
includes(:permissions).
4748
where("#{quoted_table_name}.user_id = :user OR " <<
4849
"#{quoted_table_name}.assigned_to = :user OR " <<

0 commit comments

Comments
 (0)