app/models/kaui/rails_methods.rb in kaui-0.6.6 vs app/models/kaui/rails_methods.rb in kaui-0.7.0

- old
+ new

@@ -1,30 +1,32 @@ module Kaui module RailsMethods - - # let all the rails mocks and overrides be here + def self.included(base_class) base_class.class_eval do + # Required to build urls in views extend ActiveModel::Naming include ActiveModel::Validations + # Required to make form_for work include ActiveModel::Conversion def ==(other) !other.nil? && self.class == other.class && self.to_hash == other.to_hash end def persisted? - @persisted + # Hard to know... + false end def new_record? !persisted? end def to_param - # id is a string (killbill UUID) - @id + # Hard to know (depends on the model)... + nil end def read_attribute_for_validation(attr) send(attr) end @@ -64,13 +66,9 @@ end def self.find(id) nil end - end # end class methods - end # end def included - - end end