Whatever remedies the lessor of any real property has against the lessor's immediate lessee for the breach of any agreement in the lease or for recovery of the possession, the lessor has against the assignees of the lessee for any cause of action accruing while they are assignees, except when the assignment is made by way of security for a loan and is not accompanied by possession of the premises.
§ 70-26-105, MCA