module RemoteDb module Concerns module ReadOnlyModel extend ActiveSupport::Concern included do attr_readonly(*column_names) unless abstract_class? end module ClassMethods def delete(id_or_array) raise ActiveRecord::ReadOnlyRecord end def delete_all(conditions = nil) raise ActiveRecord::ReadOnlyRecord end def update_all(conditions = nil) raise ActiveRecord::ReadOnlyRecord end end def readonly? true end def destroy raise ActiveRecord::ReadOnlyRecord end def delete raise ActiveRecord::ReadOnlyRecord end def update_column raise ActiveRecord::ReadOnlyRecord end end end end