we can used defined?() to check if a method is public or protected
backport rails 4 assign attributes