Person def name; "#{@name}, #{@title}"; end end class Letter # address letter to recipient's name without title def recipient_name super_name = Person.instance_method(:name) bound_name = super_name.bind(@recipient) bound_name.call end end
Person def name; "#{@name}, #{@title}"; end end class Letter # address letter to recipient's name without title def recipient_name super_name = Person.instance_method(:name) bound_name = super_name.bind(@recipient) bound_name.call end end
@product.variants_including_master else variants = @product.variants_including_master_and_deleted end else variants = @product.variants_including_master end else variants = Variant.scoped if current_api_user.has_spree_role?("admin") unless params[:show_deleted] variants = Variant.active end end end variants end
@product.variants_including_master else variants = @product.variants_including_master_and_deleted end else variants = @product.variants_including_master end else variants = Variant.scoped if current_api_user.has_spree_role?("admin") unless params[:show_deleted] variants = Variant.active end end end variants end
:active end end def scope scoper = @product || Variant if current_api_user.has_spree_role?("admin") && params[:show_deleted] scoper.variants_including_master_and_deleted else scoper.variants_including_master end end