Question: I am currently passing an array of keys to be excluded , using the standard \* method ...

```
params_to_scrub = ["created_at", "encrypted_password"]
@rows << user.attributes.except(*params_to_scrub)

```

Is there any way to move it into the user object and call it ?

```
@rows << user.attributes.except(user.params_to_exclude)

```

# in the User AR class

```
 def params_to_exclude
   params_to_scrub = ["created_at", "encrypted_password"]
   return *params_to_scrub
 end

```

this does(t work ...

Answer: 
You should make it a class method by adding self:

```
 def self.params_to_exclude
   params_to_scrub = ["created_at", "encrypted_password"]
 end

```

And call it like this:

```
@rows << user.attributes.except(*User.params_to_exclude)

```
Try this:-

```
@rows << user.attributes.except("created_at", "encrypted_password")

```