1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00

Merge pull request #289 from scambra/patch-1

use attribute name as symbol in hash, without table name, for activerecord scopes
This commit is contained in:
Thorsten Böttger 2016-02-09 22:22:33 +13:00
commit f98d73442a

View file

@ -82,7 +82,7 @@ module AASM
def create_for_active_record(name)
conditions = {
"#{@klass.table_name}.#{@klass.aasm(@name).attribute_name}" => name.to_s
@klass.table_name => { @klass.aasm(@name).attribute_name => name.to_s }
}
if ActiveRecord::VERSION::MAJOR >= 3
@klass.class_eval do