# How to the get limit value when user passes Model.limit(10)

**URL:** <https://www.ruby-forum.com/t/how-to-the-get-limit-value-when-user-passes-model-limit-10/260390>\
**Category:** Development\
**Created:** [October 19, 2020, 8:40am UTC](https://www.ruby-forum.com/t/how-to-the-get-limit-value-when-user-passes-model-limit-10/260390 "2020-10-19T08:40:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![akhilravuri1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f0a364/32.png) [@akhilravuri1](https://www.ruby-forum.com/u/akhilravuri1)\
**Post date:** [October 19, 2020, 8:40am UTC](https://www.ruby-forum.com/t/how-to-the-get-limit-value-when-user-passes-model-limit-10/260390/1 "2020-10-19T08:40:52Z")

</div>

Hi,

when the user calls Model.limit(10) I want is get the value of 10.

So for that, I have overloaded a function

```auto
def visit_Arel_Nodes_SelectStatement(o, collector)
    if o.limit
      limcoll = Arel::Collectors::SQLString.new
      visit o.limit, limcoll
       puts "#{limcoll}"
    end
end

```

This was working till rails 4 but it was not working in rails 6 (It prints ?)

I was trying to fix it for a long time but not succeeded  
Can anyone please help me? what is the mistake I am doing?

Thanks,  
Akhil
